Lets Play A Game

5

1 votes
Hard
Problem

Aayush and Anubhav have developed a game. They pick a number n and check if it is a power of 2. If it is, they divide it by 2 otherwise they reduce it by the greatest number which is power of 2 and less than n. Whoever reduces the number to 1 wins the game. Aayush always starts.

Given an initial value, determine who wins the game.

Example, let the initial value n = 6. It's Aayush's turn so he first determines that 6 is not a power of 2. The next lower power of 2 is 4, so he subtracts that from 6 and passes 2 to Anubhav. 2 is a power of 2, so Anubhav divides it by 2 and reaches 1. Since Anubhav reaches 1 first so he won the game.

 

Input Format

The first line contains an integer t, the number of testcases. 
Each of the next t lines contains an integer n, the initial value for the game.

Constraints

  • 1 ≤ t ≤ 10
  • 1 ≤ n ≤ 264-1

Output Format

For each test case, print the winner's name on a new line in the form Aayush or Anubhav.

Author:

Aayush Agrawal

Testers:

Aayush Agrawal

Anubhav Singh

Time Limit: 10
Memory Limit: 256
Source Limit:
Explanation

Explanation 0

  • 132 is not a power of 2 so Aayush reduces it by the largest power of 2 less than 132: 132 - 128 = 4.
  •  4 is a power of 2 so Anubhav divides by 2 to get 2 and passes it to Aayush.
  • 2 is a power of 2 so Aayush divides by 2 to get 1 and wins the game. 
Editor Image

?