You are given an array consisting of non-negative integers, and m queries. Each query is characterized by one number and consists of the following consecutive steps:
Perform the bitwise addition operation modulo 2 (xor) of each array element with the number ;
Find mex of the resulting array.
Note that after each query the array changes.
First line contains two integer numbers and — number of elements in array and number of queries.
Next line contains integer numbers — elements of then array.
Each of next m lines contains query — one integer number .
For each query print the answer on a separate line.
Mex of a sequence of numbers is the minimum non-negative number that is not present in the sequence as element. For example, and .