You are given an array a of size n and you need to perform m queries on it. There are three types of queries:
& l r x": change a_i to (a_i AND x) for all i = l, l+1, …, r;| l r x": change a_i to (a_i OR x) for all i = l, l+1, …, r;? l r": find the minimal value among a_l, a_l+1, …, a_r.Output the answers for all queries of the third type.
The first line contains one integer n (1≤n≤5⋅105) --- the size of the array.
The second line contains n space-separated integers a_i (0≤a_i<230) --- the elements of the array.
The third line contains one integer m (1≤m≤2⋅105) --- the number of queries.
Next m lines contain descriptions of queries in the format described above. For all queries 1≤l≤r≤n, for queries of the first and second types 0≤x<230.
For each query of the third type, print the answer on a separate line.