101 - ZOJ Monthly, December 2010 - G
Doraemon is playing a game with Dorami. Initially there are piles of stones on the table. Each pile consists of at most 2 stones. Each stone may be black or white. Doraemon and Dorami take turn to take away the stones, the rule is as follows:
Now the piles of stones on the table are known, Doraemon wants to know if he can win. Can you help him?
There are multiple cases (about 45000).
For each case, output two words separated by a space in one line. The first word should be "win" if Doraemon can win the game if he makes move first, otherwise it should be "lose". The second word should be "win" if Doraemon can win the game if Dorami makes move first, otherwise it should be "lose".
2 w 1 b 1 2 b 1 wb 1
lose win lose lose
Author: ZHOU, Yilun
Contest: ZOJ Monthly, December 2010