Array Game

3.3

16 votes
Arrays, Basic Programming, Basics of Implementation, Easy, Implementation, Logic-Based, Logical Reasoning
Problem

Ashish and Jeel are playing a game. They are given a multiset of arrays (initially only one array is present).
A player has to make the following move in their turn:

  • Select one of the arrays of size greater than .
  • Divide the array into two non-empty parts such that every element of the left array is smaller than every element of the right array.

Formally, if we split an array  of size  into arrays and , then the following conditions must hold:

  •  must be a non-empty prefix and  must be the remaining non-empty suffix of the array  respectively.
  • For every element of and every element of , the inequality  must hold.

A player loses if he cannot make a move. Both the players play the game optimally. If Jeel plays first, then determine who wins the game.

Input format

  • First line: An integer  denoting the number of test cases
  • Each test case:
    • First line:  An integer  denoting the size of the array
    • Second line:  space separated integers, the  integer being 

Output format

 

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

Input Constraints

Sample Input
3
3
1 2 3
3
5 3 1
3
1 1 3
Sample Output
Ashish
Ashish
Jeel

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

In the first testcase, no matter what move Jeel makes first, Ashish can always make the second move, and Jeel will be left with 3 arrays of size 1. Hence Ashish wins.

In the second testcase, Jeel cannot make any move in the first turn itself, and hence he loses.

In the third testcase, there is only one possible move, and after Jeel cut the array into [1, 1] and [3], Ashish cannot make any move, and he loses.

Editor Image

?