Block Game

Two stacks of blocks; each move removes a positive multiple of the smaller stack from the larger, and whoever empties a stack wins. Decide the winner with optimal play.

Medium7Game theoryMathNo attempts yetTime limit5sMemory limit512 MB

Problem

You are watching the International Construction by Preschoolers Contest. You are far too old to enter, so you spend the day in the stands.

Between rounds you walk around the contest area and notice a toddler, one of the contestants, playing with her blocks. She is having all the fun, so you challenge her to a game.

You build two stacks of blocks. You and the toddler then take turns removing blocks from the stack that holds more blocks. If the two stacks hold the same number of blocks, the player to move picks either stack. The number of blocks removed must be a positive multiple of the number of blocks in the smaller stack. For example, with one stack of 5 blocks and one stack of 23 blocks, the player to move may take 5, 10, 15 or 20 blocks from the stack of 23. The player who empties a stack wins.

You generously take the first move. Even so, can this toddler still beat you?

Input

One line with two integers NN and MM, the starting sizes of the two stacks, where 1N,M10181 \le N, M \le 10^{18}.

Output

Assume both players move as well as they can. Print one line holding a single word: win if you are guaranteed to win, and lose if your opponent can force you to lose.