On the first line a positive integer: the number of test cases, at most 100. After that per test case:
One line with an integer n (1 ≤ n ≤ 1 000): the number of goodies.
One line with a string, either "Petra" or "Jan": the person that chooses first.
n lines with two integers pi and ji (0 ≤ pi,ji ≤ 1 000) each: the values that Petra and Jan assign to the i-th goodie, respectively