Soccer Bets

Time limit1sMemory limit128 MB

Problem

The group stage of the FIFA World Cup is over, and the sixteen teams in the round of sixteen are known. My boss has had every remaining game analysed and has bet on the whole rest of the tournament, writing the outcome of each match on a single sheet of paper. My job was to take his bets to the nearest betting office and stake 1,000 dollars. Being nervous with so much cash in my pockets, I tripped (I am a little clumsy) and the bets got shuffled. So now I no longer know whether a given bet belongs to the final, a semi-final, or some other match.

I do not want to disappoint my boss, so I have decided to place just one bet: on the winner of the tournament. All I know is that in each round the teams that win advance to the next round (a team wins if it scores more goals than its opponent), and the losing teams are knocked out. The only exception is the semi-finals, whose two losers still play each other for third place. In total, then, there are 16 matches.

Based on my boss's bets, can you tell me which team will win the World Cup?

Input

The first line contains the number of test cases $c$ $(1 \le c \le 100)$. Each test case consists of 16 lines that describe the matches in random order. A match is described as t1 t2 g1 g2, where $t_1$ and $t_2$ are the names of the two teams (each abbreviated as exactly three uppercase letters) and $g_1$ and $g_2$ $(0 \le g_1, g_2 \le 10;\ g_1 \ne g_2)$ are the goals scored by $t_1$ and $t_2$ respectively.

Output

For each test case, print a single line with the team that will win the FIFA World Cup (according to my boss's analysis, which is always correct).