410649: GYM104069 A Abducting Nathan!

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Abducting Nathan!time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

During the 2022 Brazilian ICPC Finals in Gramado, Thiago kidnapped Nathan to prevent him from taking part in the competition! To earn his freedom from the hands of this unscrupulous monster, he can either pay a ransom (approximately R$104.00) or he can win a game of Table Tennis.

In the official rules, players alternate service every 2 points. Unfortunately, they were both so high on adrenaline that they forgot this rule! They were alternating the service every $$$k$$$ points.

Since Thiago started serving and the score is currently $$$t \times n$$$ (Thiago's and Nathan's points respectively). Write a program to determine who will be the next to serve!

Input

Every instance of the problem has $$$T$$$ test cases.

The first line of the input has a single number $$$T \ (1 \leq T \leq 10^4)$$$, the number of testcases.

Then $$$T$$$ lines follow. Each line has tree space separated integers $$$k$$$, $$$t$$$, and $$$n$$$ - $$$(1 \leq k, t, n \leq 10^9)$$$. The number of points to alternate serving, Thiago's points, and Nathan's points, respectively

Output

For each test case output a line with "Thiago" (without quotes) if he is the next to serve or "Nathan" (without quotes) otherwise.

ExamplesInput
7
2 7 1
2 2 8
5 0 0
5 3 1
5 3 2
5 3 3
10 11 11
Output
Thiago
Nathan
Thiago
Thiago
Nathan
Nathan
Thiago
Input
1
2 3 4
Output
Nathan

加入题单

算法标签: