eolymp
bolt
Try our new interface for solving problems
Problems

Tower Game (Hard)

Tower Game (Hard)

Daniel is building towers out of blocks. He has many black and white blocks. He has built n towers out of those. Now he suggests Max playing the following game. Black block will belong to Daniel and white blocks will be Max's blocks. During his turn the player can take any of his blocks from any tower and remove it and all the blocks above it. As usual the player who can't make the move loses. Daniels make the first move. Determine who will win if both players play optimally. \InputFile The first line of each test is number \textbf{n} - the number of towers. Then \textbf{n} strings follow. Each string is formed of '\textbf{B}' and '\textbf{W}' characters, where '\textbf{B}' means bleck block and '\textbf{W}' - white block. Each string describes one tower from bottom to top. \textbf{Constrains}: \textbf{1} ≤ \textbf{n }≤\textbf{ 1000}. String consist of no less than \textbf{1} character and no more than \textbf{1000} characters. \OutputFile For each test case print '\textbf{Win}' if Daniel wins and '\textbf{Loss}' if Max wins given both players play optimally.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3
WBB
WBB
BWB
Output example #1
Win