Two friends, Mirko and Slavko, are playing table soccer. Mirko has no players on the table, while Slavko's players are attached to vertical columns.
The ball starts at the left edge of the table. Mirko shoots it diagonally up and to the right. From then on, the ball moves in a straight diagonal line, reflecting off the upper and lower edges of the table.
....................
......|..|....|.....
.........|..........
......|.......|.....
L.....|.............
..............|.....
If the ball hits one of Slavko's players, Mirko does not score. If the ball reaches the right edge of the table without hitting a player, Mirko scores.
Slavko knows that he is better than Mirko, so he wants to arrange his players in a way that lets Mirko score.
Write a program that finds one arrangement of Slavko's players that lets Mirko score, and draw the path of the ball.
Slavko may move each vertical column of players up or down by an integer distance. All players in the same column move together, and every player must remain inside the table.
The first line contains two integers R and C (2 <= R, C <= 100), the number of rows and columns of the table.
Each of the next R lines contains C characters describing the initial table layout.
The ball is marked with L, players are marked with |, and empty cells are marked with .. There are no players in the leftmost column.
Output the final table layout after moving the player columns, with the ball's path drawn on it.
The test data is guaranteed to have at least one valid solution, although the solution does not have to be unique.