The first line of the input gives the number of test cases, $T$ , where $1 \leq T \leq 15$.
In each test case, the first line contains three numbers $k, m$ and $q$ separated by blanks. $k$ is the number of her friends invited where $1 \leq k \leq 150,000$. The door would open m times before all Alisha’s friends arrive where $0 \leq m \leq k$. Alisha will have $q$ queries where $1 \leq q \leq 100$.
The $i-th$ of the following $k$ lines gives a string $B_i$, which consists of no more than $200$ English characters, and an integer $v_i$, $1 \leq v_i \leq 10^8$, separated by a blank. $B_i$ is the name of the $i-th$ person coming to Alisha’s party and Bi brings a gift of value $v_i$.
Each of the following $m$ lines contains two integers $t (1 \leq t \leq k)$ and $p (0 \leq p \leq k)$ separated by a blank. The door will open right after the $t-th$ person arrives, and Alisha will let $p$ friends enter her castle.
The last line of each test case will contain $q$ numbers $n_1, . . . , n_q$ separated by a space, which means Alisha wants to know who are the $n_1-th, . . . , n_q-th$ friends to enter her castle.
Note: there will be at most two test cases containing $n > 10000$.