A. Akari
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Akari, also known as Light Up, is a logic puzzle played on a rectangular grid. The player places light bulbs in empty cells until the entire grid is illuminated.

A light bulb lights up its own cell and all cells along the horizontal and vertical directions until its light hits an obstacle or the edge of the grid. No two light bulbs should be illuminated by each other. There are clue cells in the original rules indicating exactly how many bulbs must be placed in adjacent cells. However, determining whether a puzzle is solvable has been proven to be NP-complete.

Directions of the light. (a) The light illuminates all cells in the same row or column. (b) The light is blocked by '#' and no longer lights up the '.' cell.
Invalid placement.

In this problem, a puzzle without clue cells will be provided for each test case. Please find a solution to the puzzle.

Input

The first line of the input contains two integers $$$N$$$ and $$$M$$$ — the number of rows and columns in the puzzle.

The following $$$N$$$ lines contain the description of the puzzle. Each line contains a string of length $$$M$$$, consisting of characters '.' and '#'. The character '.' denotes an empty cell and the character '#' denotes an obstacle that blocks the light.

  • $$$1\leq N, M\leq 2000$$$
Output

Mark the light bulbs you placed with the letter 'L' and output the final configuration in the same format as the given puzzle in the input. If there are multiple solutions, print any of them. It is guaranteed that at least one solution exists for the given input.

Examples
Input
3 3
...
.#.
...
Output
L..
.#L
.L.
Input
4 5
..#..
.###.
..#..
.#.#.
Output
L.#L.
.###L
.L#L.
.#L#.