Gokigen Naname - японская игра-головоломка, в которую играют на квадратной сетке. Числа в кругах расположены на некоторых пересечениях сетки.
Цель игры состоит в том, чтобы нарисовать диагональные линии в каждой ячейке сетки таким образом, чтобы число в каждом кругу равнялось количеству линий, исходящих из этого круга. Кроме того, диагональным линиям запрещено образовывать закрытый цикл.
Первый рисунок показывает начальное состояние головоломки. Второй рисунок показывает ее решение. Головоломка Gokigen Naname всегда имеет единственное решение.
The first line of the input contains a single integer n (2 ≤ n ≤ 7), the number of cells along each of the sides in the square grid. Then follow n + 1 lines containing the contents of the intersections of the grid cells. Each such line will contain a string of n + 1 characters, either a digit between 0 and 4, inclusive, or a period ('.') indicating that there is no number at this intersection (arbitrarily many lines may connect to it).
The output should contain n lines, each line containing exactly n characters. Each character should either be a slash or a backslash, denoting how the corresponding grid cell is filled.