Hide-and-Seek for Robots

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Mike is creating robots that would play hide-and-seek game. The game of hide-and-seek for robots will take place on a rectangular grid that has the size of m×nm \times n, some of its cells are occupied with robots.

Each robot looks in one of the four directions: upwards, downwards, to the left, or to the right. Each robot has its view area. Consider a robot that looks downwards. His view area contains one cell in the following row, three cells in the row next to the following, five in the next row, etc. The kk-th row has a segment of 2k12k - 1 cells in the robot's view area, its center is in the same column as the robot.

The view areas of the robots looking to the right, upwards and to the left are defined analogously.

The robot AA sees the robot BB if the cell where the robot BB is located at is in the view area of the robot AA. In order to start the hide-and-seek game for robots there must be no pair of robots on the playfield that both see another one from the pair. That is, for each pair AA, BB of robots at least one of two conditions must be satisfied: AA is not in the view area of the robot BB, or BB is not in the view area of the robot AA.

In one step Mike can turn any robot 90 degrees clockwise or counterclockwise. This operation changes the direction the robot is looking correspondingly. He would like to start the game as soon as possible, so he wants to make the minimum number of steps to get the configuration that allows to start the game.

Help him find such configuration. It can be proved that for any initial configuration of robots such configuration exists.

입력

The first line of input contains two integers mm and nn, the number of rows and the number of columns of the grid (1n,m2,0001 \le n, m \le 2\\,000).

The following mm lines contain nn characters each, each character is one of 'U', 'D', 'L', 'R', or '.'. The character 'U' denotes the robot that looks upwards, the character 'D' --- the one that looks downwards, the character 'L' --- the one that looks to the left, the character 'R' --- the one that looks to the right, the character '.' means that this cell doesn't contain a robot.

출력

Output mm lines, each must contain nn characters --- the configuration that allows to start the game. The configuration must be obtained from the one given in input by minimum number of steps. If there are several possible answers, you can output any one.

Note that Mike can only turn robots, he cannot remove them nor add them to the play field. So the robots in the output must be exactly at the same positions as in the input.