Pile of Coins

3.7

21 votes
Basic Programming, Basics of Implementation, Easy, Game Theory, Implementation, Logic-Based, Logical Reasoning
Problem

Ashish and Jeel are playing a game. They are given two piles of coins with P and Q coins respectively. They take alterate turns. During each turn, the player can choose one pile and split it into two non-zero parts and discard the other pile that is not choosen. The discarded pile cannot be used further in the game. A player loses if he cannot make a move. Both the players play the game optimally.
You are given P and Q. Determine who wins the game if Ashish plays first.

Input format

  • First line: An integer T denoting the number of test cases
  • Next T lines: Two integers P and Q

Output format

For each test case, print the winner of the game "Ashish" or "Jeel" (without quotes).
Answer for each test case should come in a new line.

Input Constraints

1T10

1P,Q106

 

Sample Input
3
1 1
1 2
2 2
Sample Output
Jeel
Ashish
Ashish
Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

In the first case, Ashish has no possible moves because both the piles are of size 1, hence Jeel wins.

In the other 2 cases, Ashish can take the pile of size 2 and split it into (1, 1) and discard the other pile. Jeel cannot make any move on (1, 1) piles, so Ashish wins.

Editor Image

?