Root NIM
Easy
Execution time limit is 1 second
Runtime memory usage limit is 122.486 megabytes
The game root NIM uses the next rules. There is a heap of n stones before two players. They take out the stones in turns. If the heap contains k stones, the player can take out of it any number of stones from 1 to int(sqrt(k)) inclusively. For example from the heap of 10 stones its possible to take 1, 2 or 3 stones. Losing a player is one who can't make a move.
By the given value of n determine whether the first player can win during regular play of both players.
Input
One number n (1 ≤ n ≤ 10^12
) - the number of stones in the heap.
Output
Print WIN if the first player wins and LOSE if the first player can't win.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 464
Acceptance rate 17%