## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Determine the Winner CodeChef Solution | CodeChef Problem Solution 2022

There is a contest containing $2$ problems $A$ and $B$.

$2$ strong participants $P$ and $Q$ participated in the contest and solved both the problems.

$P$ made AC submissions on problems $A$ and $B$ at time instants ${P}_{A}$ and ${P}_{B}$ respectively while $Q$ made AC submissions on problems $A$ and $B$ at time instants ${Q}_{A}$ and ${Q}_{B}$.

It is given that the time penalty is the minimum time instant at which a participant has solved both the problems. Also the participant with the lower time penalty will have a better rank.

Determine which participant got the better rank or if there is a TIE.

### Input Format

• The first line will contain $T$, number of test cases. Then the test cases follow.
• Each test case contains a single line of input, four integers ${P}_{A},{P}_{B},{Q}_{A},{Q}_{B}$.

### Output Format

For each test case, output P if $P$ got a better rank, Q if $Q$ got a better rank, TIE otherwise.

Note that output is case-insensitive i.e. P and p both are considered the same.

### Constraints

• $1\le T\le 1000$
• $1\le {P}_{A},{P}_{B},{Q}_{A},{Q}_{B}\le 100$