There are N terrorist and N soldiers . Every terrorist has a value and a power which is given by array A and P where A[i] and P[i] represents the value and power of ith terrorist respectively. Every soldier also has some value which is given by array B where B[i] represents the value of ith soldier. Soldiers want to kill terrorists obviously But, a soldier can decrease power of a terrorist i by atmost 1 only if A[1] & A[2]......&A[i] (Here "&" is bitwiseAND) is greater than or equal to value of that soldier. And soldiers do the work (reducing power) according to their arrival. more formally, firstly soldier 1 finishes his work then soldier 2, then soldier 3,........ so on.
Terrorist gets killed when it's power becomes 0.For every terrorist you have to tell the minimum possible index(1-based) of soldier(who reduced the power from 1 to 0) by which it will be killed and if this terrorist will alive forever then print −1.
Input
First line contains N.Next three line will contain array A,P and B respectively.
Output
Print N integers(space separated) where ith integer represents the answer of ithterrorist.
Constrains
1 <= N <= 105
1 <= A[i] <= 109
1 <= P[i] <= 105
1 <= B[i] <= 109