{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eNalim, Ocis and Remmarguts are playing on grass, and they feel very hungry now. As baby wolves, they decide to capture a little sheep to eat. Fortunately, they immediately discover a sheep roaming around the grass. However, what they found is the queen of the sheep ---- Mmxl, who has extraordinary speed that can compare with the wolves, and is very clever! Can you judge whether the baby wolves will capture Mmxl!\u003cbr\u003e\u003cbr\u003eThere are some rules to follow:\u003cbr\u003eThe grass field is a rectangular area that consist of R * C grids. And some obstacles like stones or trees exist. The actions of the baby wolves and Mmxl are taken in rounds. In each round, baby wolves take actions first, and then Mmxl follows. In the baby wolves’ turn, the three wolves will make a decision, and choose one of them to move (a move means moving from a grid to a neighboring grid). There must be a wolf to move, unless none of them can move. In the Mmxl\u0027s turn, she will always move. If she cannot move, she is captured. Baby wolves and Mmxl cannot move to the grids on which there are obstacles, and they are always on different grids. Baby wolves will never get out of the rectangular area. Once Mmxl gets away from the grass, she is never captured. \u003cbr\u003e\u003cbr\u003eYou should notice that the only situation that Mmxl is captured is that she cannot move, but is not that in wolves’ turn, some wolf is in the neighboring grid of Mmxl’s.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"Input contains multiple test cases. Each test case starts with two numbers R and C (1 \u0026lt;\u003d R, C \u0026lt;\u003d 10) in one line. Then R lines follow, each line has C characters, which describes the grass field. A \u0027.\u0027 denotes an empty grid, an \u0027X\u0027 denotes an obstacle, a \u0027W\u0027 denotes a baby wolf, and a \u0027S\u0027 denotes the Mmxl. There are exactly three \u0027W\u0027 and one \u0027S\u0027. Every test case will be followed by a blank line.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"There is only one line for each test case. If lovely Mmxl will not be captured in finity rounds, print \"Lucky Mmxl is safe:)\". If the wicked baby wolves are able to capture Mmxl, print \"Poor Mmxl is in danger:(\".\u003cbr\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 5\r\nXXW.X\r\nXWSWX\r\nXXX.X\r\n \r\n4 5\r\nXXWXX\r\nXWSWX\r\nXX.XX\r\nXX.XX\r\n \r\n7 6\r\nXXXXXX\r\nXWWW.X\r\nX....X\r\nX....X\r\nX....X\r\nX...SX\r\nXXXXXX\r\n \r\n7 7\r\nXXXXXXX\r\nXWWW..X\r\nX.....X\r\nX..X..X\r\nX.....X\r\nX....SX\r\nXXXXXXX\r\n \r\n7 7\r\nXXXXXXX\r\nXWWW..X\r\nX.....X\r\nX..XX.X\r\nX.....X\r\nX....SX\r\nXXXXXXX\r\n \r\n10 10\r\nWWW.......\r\n..........\r\n..........\r\n..........\r\n..........\r\n.....S....\r\n..........\r\n..........\r\n..........\r\n..........\r\n \r\n9 9\r\nXXXXXXXXX\r\nX...X...X\r\nXW.....WX\r\nX.X...X.X\r\nX..X.X..X\r\nX...S...X\r\nXXXXXXXXX\r\nXWXXXXXXX\r\nXXXXXXXXX\r\n \r\n9 9\r\nXXXXXXXXX\r\nX.......X\r\nXW.....WX\r\nX.X...X.X\r\nX..X.X..X\r\nX...S...X\r\nXXXXXXXXX\r\nXWXXXXXXX\r\nXXXXXXXXX\r\n \r\n9 9\r\nXXXXXXXXX\r\n....X....\r\nXW.....WX\r\nX.X...X.X\r\nX..X.X..X\r\nX...S...X\r\nXXXXXXXXX\r\nXWXXXXXXX\r\nXXXXXXXXX\r\n \r\n3 3\r\nWX.\r\nXSX\r\nWXW\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eLucky Mmxl is safe:)\r\nLucky Mmxl is safe:)\r\nPoor Mmxl is in danger:(\r\nLucky Mmxl is safe:)\r\nPoor Mmxl is in danger:(\r\nLucky Mmxl is safe:)\r\nPoor Mmxl is in danger:(\r\nLucky Mmxl is safe:)\r\nLucky Mmxl is safe:)\r\nPoor Mmxl is in danger:(\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}