{"trustable":true,"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":"\u003cp\u003eMaster Yi is a farmer. He has a large farm with many radishes planted in it. Recently, he lost some due to the stealing of wild rabbits. He thus decided to place some fences to protect all his carrots.\u003c/p\u003e\u003cp\u003eThe farm is a rectangle consisting of $$$R\\times C$$$ cells. Each cell is either empty, contains a carrot, a rabbit or a fence. Rabbits can roam freely around the farm, by repeatedly moving to the left, right, up or down to a neighboring cell. When a rabbit enters a cell with a carrot, it consumes it. However, no rabbit can enter a cell with a fence.\u003c/p\u003e\u003cp\u003eInitially there are no fences. Place fences onto the farm in such a way that no rabbit can reach any carrot, or determine that it is impossible. Note that since you have many fences, you do \u003cspan class\u003d\"tex-font-style-bf\"\u003enot\u003c/span\u003e need to minimize their number.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eFirst line contains two integers $$$R\\ (1\\le R\\le 500)$$$ and $$$C\\ (1\\le C\\le 500)$$$, denoting the number of rows and the numbers of columns respectively.\u003c/p\u003e\u003cp\u003eEach of the following $$$R$$$ lines is a string consisting of exactly $$$C$$$ characters, representing one row of the pasture. Here, \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e means a carrot, \u003cspan class\u003d\"tex-font-style-tt\"\u003eR\u003c/span\u003e is a rabbit and \u003cspan class\u003d\"tex-font-style-tt\"\u003e.\u003c/span\u003e an empty cell.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf it is impossible to protect all carrots, output a single line with the word \u003cspan class\u003d\"tex-font-style-tt\"\u003eNo\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eOtherwise, output a line with the word \u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e. Then print $$$R$$$ lines, representing the farm after placing fences. Again, \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e means a carrot, \u003cspan class\u003d\"tex-font-style-tt\"\u003eR\u003c/span\u003e is a rabbit, \u003cspan class\u003d\"tex-font-style-tt\"\u003e#\u003c/span\u003e is a fence and \u003cspan class\u003d\"tex-font-style-tt\"\u003e.\u003c/span\u003e an empty cell. You are not allowed to move, remove or add a carrot or a rabbit.\u003c/p\u003e"}},{"title":"Examples","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\u003e5 5\n....R\nC..R.\nCC..R\n.....\n.R.CC\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\n..#.R\nC.#R.\nCC#.R\n#####\n.R#CC\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}