← 返回题目列表

Codeforces · 128/A

A. 雕像

中文机器翻译题面 查看原题

在这个任务中,安娜和玛丽亚与一个非常不愉快的对手玩游戏。 Anna and Maria are in the opposite squares of a chessboard (8 × 8): Anna is in the upper right corner, and Maria is in the lower left one.除了它们之外,棋盘上还有几尊雕像。每个雕像恰好占据一个正方形。 A square that contains a statue cannot have anything or anyone — neither any other statues, nor Anna, nor Maria.

安娜作为一个人物出现在棋盘上(她站着不动,从不移动),而玛丽亚一直积极参与游戏。她的目标是——来到安娜的广场。玛丽亚和雕像依次移动,玛丽亚先移动。 During one move Maria can go to any adjacent on the side or diagonal cell in which there is no statue, or she can stay in the cell where she is.移动过程中的雕像必须同时下降一格,最底排的雕像会从棋盘上掉下来,不再出现。

在那一刻,当其中一尊雕像位于玛丽亚所在的牢房中时,这些雕像就被宣布为获胜者。当玛丽亚走进安娜一直在等待的牢房时,玛丽亚被宣布为获胜者。

显然,没有什么取决于雕像,所以这一切都取决于玛丽亚。 Determine who will win, if Maria does not make a strategic error.

输入

给你 8 个长度等于 8 的字符串,描述棋盘上的初始位置。第一行代表板的顶行,下一行代表从顶部开始的第二行,依此类推,最后一行代表底行。每个字符串与相应行中的单个单元板匹配,并且字符与相应单元的字符方式相同。如果单元格为空,则对应的字符为“.”。 If a cell has Maria, then it is represented by character "M".如果某个单元格中有 Anna,则用字符“A”表示。如果某个单元格有雕像,则该单元格由字符“S”表示。

保证第一行的最后一个字符始终为“A”,最后一行的第一个字符始终为“M”。其余字符为“.”。或“S”。

输出

如果 Maria 获胜,则打印字符串“WIN”。如果雕像获胜,则打印字符串“LOSE”。

示例

输入 #1

.......A
........
........
........
........
........
........
M.......

输出 #1

WIN

输入 #2

.......A
........
........
........
........
........
SS......
M.......

输出 #2

LOSE

输入 #3

.......A
........
........
........
........
.S......
S.......
MS......

输出 #3

LOSE