Beautiful Rectangle

No attempts yetTime limit1sMemory limit128 MB

Problem

A rectangle has height NN and width MM. Draw every line that cuts it into N×MN \times M unit squares. In each cell draw exactly one diagonal, either the one that runs from the top left corner to the bottom right corner or the one that runs from the top right corner to the bottom left corner. A rectangle with one diagonal in every cell is a valid rectangle.

Now color every point of the drawing, that is, the corners of the rectangle and every point where segments meet, red, green, or blue. If all points can be colored so that two points joined directly by a segment always get different colors, the valid rectangle is a beautiful rectangle.

Hongjun had a beautiful rectangle, but Myungwoo played a prank beside him and erased the diagonals of some cells. Among the beautiful rectangles that agree with every diagonal still left, find the one that comes first in lexicographic order.

Lexicographic order compares the string built by reading the diagonal of each cell row by row from the top, and left to right inside a row. A diagonal is written as \ or /. The ASCII code of / is 47 and the ASCII code of \ is 92, so / comes before \.

Input

The first line contains the height NN and the width MM. (1N,M501 \le N, M \le 50)

Each of the next NN lines contains a string of length MM. The jj-th character of the ii-th line is the diagonal left in the cell in row ii from the top and column jj from the left, either \ or /. A cell that Myungwoo erased is given as ?.

Output

Print the beautiful rectangle that comes first in lexicographic order among those that agree with every diagonal still left, on NN lines in the same format as the input. If no such rectangle exists, print impossible.