"Counter Strike is a first person shooting game in which players have to kill their opponents."
In IIIT-A , all the first year students are busy in playing counter strike 1.6 as it is the most prestigious game of the college. Almost all the students are playing it except Chotu.
One day he was amazed to see that whenever a person kills another , a line appears on the screen "A killed B" . He suddenly noted down all the lines.
Now being a coder he is interested in knowing that who killed most number of persons and who died the most number of times.
If there is a tie between two then he is interested in lexicographically smallest name. Can you help him out ?????
Input
First line contains T denoting number of test cases.
Next line contains an integer N denoting number total lines.
Next N lines contains a line in the form "A killed B".
Output
For each test case, print two strings A and B denoting persons who killed most number of persons and who died the most number of times respectively.
Constraints
1 <= T <= 10
1 <= N <= 105
|S| <= 20
string can comprise of lowercase letters, uppercase letters and digits.
In the first case psyduck has most number of kills and prince died the most number of times.
In the second case there a tie because of equal number of kills so print the lexicographically smallest.