K-th Minimum Number
View as PDFGiven an array  of 
 numbers, you need to answer 
 queries of the form 
l' r' k', where you output the  minimum number in the range 
.
Constraints
Input Specification
The first line will contain  and 
, the number of elements in the array and the number of queries.
The second line will contain  space-separated integers, the elements of 
.
The next  lines will contain a query defined above.
Note that this problem will be online enforced, meaning that input will be given in an encrypted format. To encrypt the data, the values  in queries will be given as 
, and 
, where 
 denotes the bitwise XOR operation. Note that 
 at any time is defined as the answer to the latest query. If no queries have occurred so far, 
.
Output Specification
Output  lines, the answers to the queries.
Sample Input (Encrypted)
5 5
1 3 4 5 1
1 5 3
0 6 0
6 6 4
5 6 6
2 6 6
Sample Input (Unencrypted)
5 5
1 3 4 5 1
1 5 3
3 5 3
3 3 1
1 2 2
1 5 5
Sample Output
3
5
4
3
5
Comments