Hayden got bored after playing the game "Game of Rooks" with GL. So Hayden created a new game called "Game of Pawns".
A board contains cells where the pawns can be placed, labelled $1$ to $N$. Hayden's and GL's pawns were initially positioned on distinct cells, $A$ and $B$, respectively. They take turns moving their pawn, starting with Hayden. During a player's turn, his pawn can be moved either one cell to the left or one cell to the right, as long as the destination cell exists. For example, on the first turn, Hayden's pawn can be moved to either cell $A−1$ or $A+1$, if these cells exist. It is important to note that each player's pawn must be moved during his turn and cannot remain on the same cell.
However, there are some restrictions. The two pawns cannot occupy the same cell. This means that Hayden's pawn cannot be moved to a cell that GL's pawn is currently occupying, and vice versa. If a player's pawn cannot make a valid move on his turn, he loses the game. As a result, the other player wins.
Hayden and GL will play $T$ rounds. Determine who is the winner of each round, assuming that both players play optimally. It can be proven that every game will end after a finite number of moves if both players play optimally.
Input
The first line of input contains one integer, $T$.
The following $T$ lines contains three integers, $N$, $A$ and $B$.
Output
Output $T$ lines.
For the $i$-th line, output Hayden
or GL
, the name of the winner of the $i$-th round.
Constraints
For all cases, $1 \le T \le 10^5$, $2 \le N \le 10^9$, $1 \le A, B \le N$ where $A \ne B$
Subtask 1 (20%): $1 \le T \le 100$, $1 \le N \le 10$, $\left|A−B\right| \le 2$
Subtask 2 (25%): $1 \le T \le 100$, $1 \le N \le 20$
Subtask 3 (25%): $1 \le T, N \le 10^3$
Subtask 4 (30%): No additional constraints
Sample Test Cases
Input | Output | |
---|---|---|
3 3 1 3 5 1 2 5 2 4 |
Hayden GL Hayden |
Scoring: Per Subtask
Authored by wy24180
Appeared in WYHK 2025 Mini Contest 3