Tower Game (Hard)#3173

Tower Game (Hard)

1 секунда
64 мегабајти
Тешко

Danya builds towers out of blocks. This time, he has many black and white blocks. He has built towers from these blocks. Now, he invites Max to play the following game. Black blocks belong to Danya, and white blocks belong to Max. On a player's turn, the player can choose any of their blocks from any tower and remove it along with all blocks above it. As usual, the player who cannot make a move loses. Danya makes the first move. Determine who will win if both players play optimally.

Влез

The first line contains the integer — the number of towers. Then lines follow, each consisting of the characters 'B' and 'W'. The character 'B' represents a black block, and 'W' a white block. Each line describes one tower from bottom to top.

Constraints: 1 \leq n \leq 1000, each line contains at least one and at most characters.

Излез

Output a single line: "Win" if Danya wins, or "Loss" if Max wins, given both players play optimally.

Примери

Пример 1

Loading
Loading