410443: GYM104022 A Best Player

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Best Playertime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

Though Bob has finally returned to the college, he has to stay in his dorm with the other three roommates. Don't know who proposes.

"Let's play a game!"

It was meant to be light-hearted, and the rules are as follows:

  • A roommate is designated in turn, and he writes down on paper the coordinates of $$$n$$$ points in three-dimensional Euclidean space.
  • Each of the other roommates selects one of the $$$X$$$-axis, the $$$Y$$$-axis, and the $$$Z$$$-axis, but no two of them make the same choice. After that, each of them counts the number of points after projecting all written points along the direction of the chosen axis. Under the projection, some points may not be distinguishable. Points $$$(1, 2, 1)$$$ and $$$(1, 2, 5)$$$ projected along the direction of the $$$Z$$$-axis, for instance, are not distinguishable.
  • The roommate with the most points counted will win the game. In case of a tie, the one with the most points counted whose selected axis has the smallest character in the alphabetical order will be the winner. Note that in the alphabetical order $$$X$$$ is less than $$$Y$$$, $$$Y$$$ is less than $$$Z$$$, and by transitivity, $$$X$$$ is less than $$$Z$$$.

Bob does want to win.

"Please help me; I entreat you."

Add flowers to brocade people, all over finish is; Give timely assistance and have several people?

Input

The first line contains an integer $$$n$$$ $$$(1 \leq n \leq 100)$$$.

In the next $$$n$$$ lines, each line contains three integers $$$x$$$, $$$y$$$ and $$$z$$$ $$$(-100 \leq x, y, z \leq 100)$$$, representing a three-dimensional point at $$$(x, y, z)$$$.

Output

Output a character $$$t$$$ $$$(t \in \{X, Y, Z\})$$$ in a line indicating that the winner's choice is the $$$t$$$-axis. Note that the output characters are case-sensitive.

ExamplesInput
2
1 1 1
1 2 1
Output
X
Input
3
1 2 9
1 2 2
2 2 9
Output
Y
Input
4
-100 -100 100
-100 100 100
100 -100 100
100 100 100
Output
Z

加入题单

算法标签: