#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 NN empty arrays, t1,...,tnt_1, ..., t_n. At first, you execute MM queries as follows.

  • add a value vv to array tit_i (aleqileqba \\leq i \\leq b)

Next, you process QQ following output queries.

  • output the jj-th number of the sequence sorted all values in tit_i (xleqileqyx \\leq i \\leq y)

Input

The dataset is formatted as follows.

NN MM QQ a1a_1 b1b_1 v1v_1 ... aMa_M bMb_M vMv_M x1x_1 y1y_1 j1j_1 ... xQx_Q yQy_Q jQj_Q

The first line contains three integers NN (1leqNleq1091 \\leq N \\leq 10^9), MM (1leqMleq1051 \\leq M \\leq 10^5) and QQ (1leqQleq1051 \\leq Q \\leq 10^5). Each of the following MM lines consists of three integers aia_i, bib_i and viv_i (1leqaileqbileqN1 \\leq a_i \\leq b_i \\leq N, 1leqvileq1091 \\leq v_i \\leq 10^9). Finally the following QQ lines give the list of output queries, each of these lines consists of three integers xix_i, yiy_i and jij_i ($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 jj-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 MM-th query is executed, each tit_i 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