#icpc2013springi. [icpc2013spring_i]The J-th Number
[icpc2013spring_i]The J-th Number
$(function(){document.getElementById("fixed-server-timer").style.display = "none";})
Problem Statement
You are given empty arrays, . At first, you execute queries as follows.
- add a value to array ()
Next, you process following output queries.
- output the -th number of the sequence sorted all values in ()
Input
The dataset is formatted as follows.
... ...
The first line contains three integers (), () and (). Each of the following lines consists of three integers , and (, ). Finally the following lines give the list of output queries, each of these lines consists of three integers , and ($1 \\leq x_i \\leq y_i \\leq N, 1 \\leq j_i \\leq Σ_{x_i \\leq k \\leq y_i} |t_k|$).
Output
For each output query, print in a line the -th number.
Sample Input 1
5 4 1
1 5 1
1 1 3
4 5 1
3 4 2
1 3 4
Output for the Sample Input 1
2
After the -th query is executed, each is as follows:
\[1,3\], \[1\], \[1,2\], \[1,1,2\], \[1,1\]
```The sequence sorted values in $t_1$, $t_2$ and $t_3$ is \[1,1,1,2,3\]. In the sequence, the 4-th number is 2.
### Sample Input 2
```plain
10 4 4
1 4 11
2 3 22
6 9 33
8 9 44
1 1 1
4 5 1
4 6 2
1 10 12
Output for the Sample Input 2
11
11
33
44
Source Name
Japan Alumni Group Spring Contest 2013