The first line of the standard input contains three integers $n$, $m$, and $o$ ($1 \le n,m \le 500000, 1 \le o \le \min(m,n)$), denoting the number of rooms in the hotel, the number of offers received and the maximum number of offers your friend is willing to accept. The next $n$ lines describe the rooms, with the $i$-th of these lines containing two integers $c_i$, $p_i$ representing the upkeep of the room in zlotys and the capacity of the room ($1 \le c_i,p_i \le 10^9$). The next m lines describe the offers, with the $j$-th of these lines containing two integers $v_j, d_j$ representing the offered rental price in zlotys and the minimal capacity of the requested room ($1 \le v_j,d_j \le 10^9$).
You may assume that in test cases worth 40 points in total an additional inequality $n,m \le 100$ holds.