{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\n \u003cp\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eThis is an interactive problem.\u003c/span\u003e\u003c/p\u003e\n \u003cp\u003eVladik has favorite game, in which he plays all his free time.\u003c/p\u003e\n \u003cp\u003eGame field could be represented as \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e × \u003ci\u003em\u003c/i\u003e\u003c/span\u003e matrix which consists of cells of three types: \u003c/p\u003e\n \u003cul\u003e \n \u003cli\u003e «\u003cspan class\u003d\"tex-font-style-tt\"\u003e.\u003c/span\u003e» — normal cell, player can visit it. \u003c/li\u003e\n \u003cli\u003e «\u003cspan class\u003d\"tex-font-style-tt\"\u003eF\u003c/span\u003e» — finish cell, player has to finish his way there to win. There is exactly one cell of this type. \u003c/li\u003e\n \u003cli\u003e «\u003cspan class\u003d\"tex-font-style-tt\"\u003e*\u003c/span\u003e» — dangerous cell, if player comes to this cell, he loses. \u003c/li\u003e\n \u003c/ul\u003e\n \u003cp\u003eInitially player is located in the left top cell with coordinates \u003cspan class\u003d\"tex-span\"\u003e(1, 1)\u003c/span\u003e. \u003c/p\u003e\n \u003cp\u003ePlayer has access to \u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003e buttons \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eU\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eD\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eL\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eR\u003c/span\u003e\", each of them move player up, down, left and right directions respectively.\u003c/p\u003e\n \u003cp\u003eBut it’s not that easy! Sometimes friends play game and change functions of buttons. Function of buttons \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eL\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eR\u003c/span\u003e\" could have been swapped, also functions of buttons \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eU\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eD\u003c/span\u003e\" could have been swapped. Note that functions of buttons can be changed only at the beginning of the game.\u003c/p\u003e\n \u003cp\u003eHelp Vladik win the game!\u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"input-specification\"\u003e\n \u003cdiv class\u003d\"section-title\"/div\u003e\n \u003cp\u003eFirst line contains two space-separated integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003em\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e ≤ 100\u003c/span\u003e) — number of rows and columns respectively.\u003c/p\u003e\n \u003cp\u003eEach of next \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lines contains \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003em\u003c/i\u003e\u003c/span\u003e characters describing corresponding row of field. Set of characters in field is described above.\u003c/p\u003e\n \u003cp\u003eGuaranteed that cell with coordinates \u003cspan class\u003d\"tex-span\"\u003e(1, 1)\u003c/span\u003e is normal and there is at least one way from initial cell to finish cell without dangerous cells. \u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Intercation","value":{"format":"HTML","content":"\u003cp\u003eYou can press buttons no more than \u003cspan class\u003d\"tex-span\"\u003e2·\u003ci\u003en\u003c/i\u003e·\u003ci\u003em\u003c/i\u003e\u003c/span\u003e times.\u003c/p\u003e\u003cp\u003eTo press a button you should print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eU\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eD\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eL\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eR\u003c/span\u003e\" in new line. It’s necessary to print newline character and \u003cspan class\u003d\"tex-font-style-tt\"\u003eflush\u003c/span\u003e output. After flushing buffer you should read answer from input data. Answer is the pair of space-separated integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ey\u003c/i\u003e\u003c/span\u003e — new position of player. In case, if there is no cell in direction of moving, position will not change. If after any move player lost, in other words player move to dangerous cell, then \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ey\u003c/i\u003e\u003c/span\u003e will be equal to \u003cspan class\u003d\"tex-span\"\u003e - 1\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eIf after any move player is in finish or dangerous cell, then you should terminate your program.\u003c/p\u003e\u003cp\u003eTo finish output buffer (i. e. for operation \u003cspan class\u003d\"tex-font-style-tt\"\u003eflush\u003c/span\u003e) right after printing direction and newline you should do next:\u003c/p\u003e\u003cul\u003e \u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003efflush(stdout)\u003c/span\u003e in C++ \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eSystem.out.flush()\u003c/span\u003e in Java \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003estdout.flush()\u003c/span\u003e in Python \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eflush(output)\u003c/span\u003e in Pascal \u003c/li\u003e\u003cli\u003e read documentation for other languages. \u003c/li\u003e\u003c/ul\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e\u003cdiv class\u003d\"sample-tests\"\u003e\n \u003cdiv class\u003d\"section-title\"/div\u003e\n \u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e4 3\u003cbr\u003e...\u003cbr\u003e**.\u003cbr\u003eF*.\u003cbr\u003e...\u003cbr\u003e1 1\u003cbr\u003e1 2\u003cbr\u003e1 3\u003cbr\u003e1 3\u003cbr\u003e2 3\u003cbr\u003e3 3\u003cbr\u003e4 3\u003cbr\u003e4 2\u003cbr\u003e4 1\u003cbr\u003e3 1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eR\u003cbr\u003eL\u003cbr\u003eL\u003cbr\u003eD\u003cbr\u003eU\u003cbr\u003eU\u003cbr\u003eU\u003cbr\u003eR\u003cbr\u003eR\u003cbr\u003eD\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cdiv class\u003d\"note\"\u003e\n \u003cdiv class\u003d\"section-title\"Note/div\u003e\n \u003cp\u003eIn first test case all four directions swapped with their opposite directions. Protocol of interaction In more convenient form:\u003c/p\u003e\n \u003cp\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/b5d053d0551e8477c7692bd8a6e52b61?v\u003d1500273140\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" SRC\u003d\"CDN_BASE_URL/b5d053d0551e8477c7692bd8a6e52b61?v\u003d1500273140\"\u003e\u003c/p\u003e\n \u003cp\u003eThis test could be presenter for hack in following way: \u003c/p\u003e\n \u003cpre\u003e\u003cbr\u003e4 3 1 1\u003cbr\u003e...\u003cbr\u003e**.\u003cbr\u003eF*.\u003cbr\u003e...\u003cbr\u003e\u003c/pre\u003e \n\u003c/div\u003e"}}]}