Lines (2)#1062

Lines (2)

1 second
64 megabytes
Medium

In a table with rows and columns, some cells contain balls, while others are empty. A ball is selected to be moved, along with the cell to which it should be moved. The selected ball can move in one step to an adjacent empty cell, either horizontally or vertically. It is required to determine whether it is possible to move the ball from the initial cell to the specified cell, and if so, to find a path with the minimum number of moves.

Input

The first line contains the number (2 \leq N \leq 250). Each of the next lines contains characters. The dot character "." represents an empty cell, the capital Latin letter represents a ball, is the initial position of the ball to be moved, and the capital Latin letter is the target position for the ball.

Output

Print if the movement is possible; otherwise, print . If the movement is possible, then print lines of characters—formatted as in the input, but replacing and all dots along the chosen path with plus signs .

Examples

Example 1

Loading
Loading