Alice and Bob are playing a game. They have an integer . Alice has distinct intgers and Bob has distinct integers each of which is between to (both inclusive). The Game starts with a starting integer . In each turn each player can pick any number from his set of ditinct integers and add it to . If becomes greater than N, is assigned the value i.e The integer is cyclic over . (For example if is and current value of is , and the integer to be added is chosen as , then value of becomes )
If the value of after a player adds an integer from his set, becomes then that player wins the game. Alice goes first and Bob goes second. Both Alice and Bob play ideally and if a player can't win the game he would try to not let other person win the game. Thus there are three possible outcomes Alice wins, Alice loses(or Bob wins), the game continues infinitely and never ends. Alice wants to determine for what starting values of X can she win the game.
Help Alice determine what will be the result of the game for each .
Note : Each player can chose a integer from his set multiple times (if someone chose integer for his current turn he can again chose for his next turn too)
INPUT:
First line contains a single integer
Second line contains single integer
Third line contains distinct integers each between and
Fourth line contains a single integer
Fifth line contains distinct integers each between and
OUTPUT:
For each , print if Alice wins the game, if Alice loses the game , if the game continues infinitely
i.e output intgeres in a single line (, or ) of which should be the result of game for strarting value of
CONSTARINTS: