Divide and Subtract Game
Submissions: 364   Accuracy:

15.66%

  Difficulty: Medium   Marks: 4

Jon and Arya are playing a game. Rules of game as follows:

 ·  They have a single number N initially.

 ·   Both will play on alternate move. Jon starts first.

 ·   Both will play each move optimally.

 ·   In each move, they can perform only one of these operation

          1. Divide that number by 2, 3, 4 or 5 and take floor of result.

          2. Subtract that number by 2, 3, 4 or 5.

 ·   When number become zero game will stop.

 ·   Who move last move in game will win this game.

 

Input

First line of input contain a integer T as test cases, next T line contain a single integer N.

 

Output

Print name of winner on each test case in separate line.

 

Sample Input:

2
3
6

 

Sample Output:

Jon
Arya

 

Explanation

For first test case Jon will subtract 3 from initial number and win the game. For the second test case Jon will divide by 3 and then in next step arya will subtract by 2 and win the game.

 

Constraints

1<=T=10000

1<=N<=2000000

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Raju Varshney
Author: rajuknit


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.