For this Question: Abhi and Niyu play a game where they need to destroy N palaces (numbered through 1 to N) to pass a level. Abhi performs an attack with frequency p hits per second and Niyu performs an attack with frequency q hits per second i.e. each character spends fixed time to raise a weapon and then they hit (the time to raise the weapon is 1 / p seconds for Abhi and 1 / q seconds for Niyu). The i-th palace destroys if it receives m number of hits.

Abhi and Niyu wonder who makes the last hit on each Palace. 
If Abhi and Niyu make the last hit at the same time, we assume that both of them have made the last hit.

Note:- Each castle is to be destroyed individually.The first line contains three integers N, p, q — the number of palaces, the frequency of Abhi's and Niyu's attack, correspondingly.
Next N lines contain a single integer m i. e the number of hits required to destroy the ith palace

Constraints:-
1 ≤ m ≤ 10<sup>9</sup> 
1 ≤ N ≤ 10<sup>5</sup> 
1 ≤ p, q ≤ 10<sup>6</sup>Print n lines. In the i-th line print word "Abhi", if the last hit on the i-th palace was performed by Abhi, "Niyu", if Niyu performed the last hit, or "Both", if both performed it at the same time.Sample Input:-
4 3 2
1
2
3
4

Sample Output:-
Abhi 
Niyu 
Abhi
Both

Explanation:-
In the first sample Abhi makes the first hit at time 1/3, Niyu makes the second hit at time 1/2, Abhi makes the third hit at time 2/3, and both boys make the fourth and fifth hit simultaneously at the time 1.

Sample Input:-
2 1 1
1
2

Sample Output:-
Both
Both
, I have written this Solution Code: n,p,q = map(int,input().split())
l = []
for i in range(n):
	ele = int(input())
	l.append(ele)

li = []
size = 0
f = 0

x = 2*(p+q)
dic = {0:[1,1]}

for j in range(1,2*(p+q)+1):
	pi = dic[j-1][0]
	qi = dic[j-1][1]
	ans = ""

	if(pi/p == qi/q):
		ans = "Both"
		pi+=1
		qi+=1
		dic[j] = [pi,qi];
		dic[j+1] = [pi,qi]
		f = 1
		
	elif(pi/p < qi/q):
		ans = "Abhi"
		pi+=1
		dic[j] = [pi,qi];
		
	elif(pi/p > qi/q):
		qi+=1
		ans = "Niyu"
		dic[j] = [pi,qi];
	
	li.append(ans)
	size += 1

	if(f == 1):
		li.append(ans)
		size += 1
		break

for m in l:
	print(li[m%size-1]), In this Programming Language: Python, Now tell me if this Code is compilable or not?