{"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\"\u003ePusherBoy is an online game http://www.hacker.org/push . There is an R * C grid, and there are piles of blocks on some positions. The goal is to clear the blocks by pushing into them. \u003cbr\u003e\u003cbr\u003eYou should choose an empty area as the initial position of the PusherBoy. Then you can choose which direction (U for up, D for down, L for left and R for right) to push. Once the direction is chosen, the PusherBoy will walk ahead until he met a pile of blocks (Walking outside the grid is invalid). Then he remove one block from the pile (so if the pile contains only one block, it will become empty), and push the remaining pile of blocks to the next area. (If there have been some blocks in the next area, the two piles will form a new big pile.)\u003cbr\u003e\u003cbr\u003ePlease note if the pusher is right up against the block, he can\u0027t remove and push it. That is, there must be a gap between the pusher and the pile. As the following figure, the pusher can go up, but cannot go down. (The cycle indicates the pusher, and the squares indicate the blocks. The nested squares indicate a pile of two blocks.)\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/f827235c089986ef7fb278944bcd68b5?v\u003d1714991843\"\u003e\u003c/center\u003e \u003cbr\u003e\u003cbr\u003eAnd if a whole pile is pushed outside the grid, it will be considered as cleared.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are several test cases in each input. The first two lines of each case contain two numbers C and R. (R,C \u0026lt;\u003d 25) Then R lines follow, indicating the grid. \u0027.\u0027 stands for an empty area, and a lowercase letter stands for a pile of blocks. (\u0027a\u0027 for one block, \u0027b\u0027 for two blocks, \u0027c\u0027 for three, and so on.)\u003cbr\u003e\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Output three lines for each case. The first two lines contains two numbers x and y, indicating the initial position of the PusherBoy. (0 \u0026lt;\u003d x \u0026lt; R, 0 \u0026lt;\u003d y \u0026lt; C). The third line contains a moving sequence contains \u0027U\u0027, \u0027D\u0027, \u0027L\u0027 and \u0027R\u0027. Any correct answer will be accepted."}},{"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\r\n7\r\n...\r\n...\r\n.b.\r\n...\r\n...\r\n.a.\r\n...\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n1\r\nUDU\r\n[center][img]../../../data/images/2821-2.jpg[/img][/center] \u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cbr\u003eHint: The following figures show the sample. The circle is the position of the pusher. \u003cbr\u003eAnd the squares are blocks (The two nested squares indicating a pile of two blocks). And this is the unique solution for this case.\u003cbr\u003e"}}]}