URI Online Judge | 2500
# William Xorando

**Timelimit: 1**

By Francisco Elio Parente Arcos Filho, UEA Brazil

William recently learned some properties of the bit to bit operator xor (represented by the operator '^' in C language ). He realized that he can do many interesting algorithms with it: Find lonely elements in a sequence, exchange values without auxiliary variable, encryption and many others. Then he began to experiment and decided to name an operation using xor with its name, the w-xor. The w-xor operation is performed on a sequence of values. Example: it is an **S**={a_{1}, a_{2}, a_{3}, a_{4}}, applying w-xor over the sequence **S** once is equivalent to:

a_{1}= a_{1}^a_{2}^a_{3}^a_{4}

a_{2}= a_{1}^a_{2}^a_{3}^a_{4}

a_{3}= a_{1}^a_{2}^a_{3}^a_{4}

a_{4}= a_{1}^a_{2}^a_{3}^a_{4}

a_{1}= a_{1}^a_{2}^a_{3}^a_{4}

If **S**={a_{1}, a_{2}, a_{3}, a_{4}, a_{5}} then applying w-xor over **S** once is:

a_{1}= a_{1}^a_{2}^a_{3}^a_{4}^a_{5}

a_{2}= a_{1}^a_{2}^a_{3}^a_{4}^a_{5}

a_{3}= a_{1}^a_{2}^a_{3}^a_{4}^a_{5}

a_{4}= a_{1}^a_{2}^a_{3}^a_{4}^a_{5}

a_{5}= a_{1}^a_{2}^a_{3}^a_{4}^a_{5}

a_{1}= a_{1}^a_{2}^a_{3}^a_{4}^a_{5}

Given a sequence **S** and applying w-xor **M** times over it, you would know what the value of the **K**-th position?

The input consists of several test cases. Each test case begins with three integers 2 ≤ **N** ≤ 10^{3}, 1 ≤ **M** ≤ 10^{6} and 1 ≤ **K** ≤ **N** representing the number of elements of the sequence, the number of w-xor operations applied and the position of the value to be found (note that the first position is 1), respectively. On the next line, there will be **N** integer values -10^{9} ≤ **A**_{i} ≤ 10^{9}. The entry ends when **N=M=K=0**.

The output consists of one line per test case containing the value of the **K**-th position of the sequence after applied **M** times the w-xor on it.

Input Sample | Output Sample |

4 2 2 7 3 9 3 5 3 2 5 4 3 2 1 0 0 0 |
3 2 |