The first line of the input gives the number of test cases, $T \; (1 \le T \le 30)$. $T$ test cases follow.
For each test case, the first line contains two integers $n, m \; (1 \le n, m \le 1000)$, representing the number of students in Class 1 and Class 2.
Then $(n + m)$ lines follow, describing the students. The $i^\mathrm{th}$ line contains two integers $w_i, v_i \; (1 \le w_i \le 1000, \; -10^9 \le v_i \le 10^9)$, representing the strength and the beauty-value of the $i^\mathrm{th}$ student. The first $n$ students come from Class 1, while the other $m$ students come from Class 2.
The sum of $(n + m)$ in all test cases doesn't exceed $10^4$.