HUBULLU  Hubulullu
After duelling in quake (a multiplayer game), Airborne and Pagfloyd decide do test themselves out in another game called Hubulullu. The rules of the game are as follows:
N wooden pieces (marked with numbers 1 to N) are placed in a transparent bottle. On his turn the first player takes out some piece (numbered x) and all the pieces numbered by divisors of x that are present in the transparent bottle. The second player picks another number and removes it and its divisors as well. Play continues in an alternating fashion until all pieces have been removed from the bottle. The player who removes the last piece from the bottle wins the game.
Both players play optimally. Given N (the number of wooden pieces in the transparent bottle initially) and the name of the player who starts the game, determine the winner.
Input
The first line of the input contains an integer t, the number of test cases. t test cases follow.
Each test case consists of a single line containing two integers separated by a single space. The first integer is N (1 <= N <= 2000000000), indicating the number of pieces, and the second integer indicates the player who starts  "0" means Airborne starts the game and "1" means Pagfloyd starts the game (quotes for clarity).
Output
For each test case output one line containing either "Airborne wins." or "Pagfloyd wins."
For each N, it's possible to determine a winner if both players play optimally.
Example
Input: 1 1 0 Output: Airborne wins.
hide comments
le_louch007:
20240504 00:39:46
Don't get excited because it showed AC just because you printed who starts first, rather think why the winner is the one who start first.


otoya:
20240412 19:03:25
hahahaha lil bro needs to think hard to solve this 

cff_0102:
20240202 03:12:22
there's a nice way to prove it. consider who will win when 2N left 

distructo:
20200923 15:01:47
Lol;;;; ;) 

shouravahmed:
20200329 18:44:56
LOL !! 

mrmajumder:
20200208 16:48:34
Think, think, think 

Jumpy:
20190323 09:04:25
In the beginning, I was thinking of some tough pattern. later on, some observation told, it has nothing to do with the value of N. 

shubham_03:
20190104 19:28:10
Just required observation and the rest is easy... 

salman3007:
20181015 04:10:58
the optimal strategy would be that each player must ensure that even no. of sets of coprime numbers are passed to the next round. 

vivek_dwivedi:
20180626 10:51:06
great problem ! those who are saying its easy they just solved with pattern. try to prove it .its fun 
Added by:  Matthew Reeder 
Date:  20061029 
Time limit:  1.787s 
Source limit:  30000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  AlKhawarizm 2006 