Task
Iggy the martian absolutely loves bitwise operations, and to celebrate his love for them he has prepared the following challenge for you:
He has given you his favorite integer array , after which he commanded you to perform tasks. A task can be one of the following:
- Replacement operation. Given and , Iggy wants you to replace with .
- And operation. Given , , , Iggy wants you to replace with for each (), where denotes the bitwise AND operation.
- Print operation. Given and , tell Iggy the value of .
Input data
The first line will contain one integer, ().
The second line will contain integers, , , , ..., ().
The third line will contain one integer, (.
Each of the next lines begins with a number ().
If , it will be followed by two integers and ().
If , it will be followed by three integers , and ().
If , it will be followed by two integers and ().
Output data
Print the answers for the type tasks, one on each line.
Example
stdin
12
18 13 10 2 8 1 5 5 11 10 13 19
7
3 3 4
1 6 19
2 5 12 5
1 2 4
1 9 2
3 7 12
3 2 9
stdout
12
18
29
Explanation
After the second task, the array becomes: .
After the third task, the array becomes: .
After the fourth task, the array becomes: .
After the fifth task, the array becomes: .