Problem: Pavel loves grid mazes. A grid maze is an n × m rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side.

Pavel drew a grid maze with all empty cells forming a connected area. That is, you can go from any empty cell to any other one. Pavel doesn't like it when his maze has too little walls. He wants to turn exactly k empty cells into walls so that all the remaining cells still formed a connected area. Help him.

Input

The first line contains three integers n, m, k (1 ≤ n, m ≤ 500, 0 ≤ k < s), where n and m are the maze's height and width, correspondingly, k is the number of walls Pavel wants to add and letter s represents the number of empty cells in the original maze.

Each of the next n lines contains m characters. They describe the original maze. If a character on a line equals ".", then the corresponding cell is empty and if the character equals "#", then the cell is a wall.

Output

Print n lines containing m characters each: the new maze that fits Pavel's requirements. Mark the empty cells that you transformed into walls as "X", the other cells must be left without changes (that is, "." and "#").

It is guaranteed that a solution exists. If there are multiple solutions you can output any of them.

Examples

Input

3 4 2
#..#
..#.
#...


Output

#.X#
X.#.
#...


Input

5 4 5
#...
#.#.
.#..
...#
.#.#


Output

#XXX
#X#.
X#..
...#
.#.#

Solution (in PYTHON3):

Solution:
n, m, k = map(int, input().split())
grid = []
hashes = 0
for i in range(n):
    grid.append(input())
    hashes += grid[i].count('#')
s_r, s_c = 0,0
for i in range(n):
    if '.' in grid[i]:
        s_r, s_c = i, grid[i].index('.')
        break
vn = 1
remaining = n*m-k-hashes
visited = set([(s_r, s_c)])
q = [(s_r, s_c)] if grid[s_r][s_c] == '.' else []
while len(q) > 0:
    if vn == remaining:
        break
    s_r, s_c = q.pop()
    if s_r > 0 and grid[s_r-1][s_c] == '.' and (s_r-1, s_c) not in visited:
        q.append((s_r-1, s_c))
        visited.add((s_r-1, s_c))
        vn += 1
        if vn == remaining:
            break
    if s_r < n-1 and grid[s_r+1][s_c] == '.' and (s_r+1, s_c) not in visited:
        q.append((s_r+1, s_c))
        visited.add((s_r+1, s_c))
        vn += 1
        if vn == remaining:
            break
    if s_c > 0 and grid[s_r][s_c-1] == '.' and (s_r, s_c-1) not in visited:
        q.append((s_r, s_c-1))
        visited.add((s_r, s_c-1))
        vn += 1
        if vn == remaining:
            break
    if s_c < m-1 and grid[s_r][s_c+1] == '.' and (s_r, s_c+1) not in visited:
        q.append((s_r, s_c+1))
        visited.add((s_r, s_c+1))
        vn += 1
        if vn == remaining:
            break
#print(len(visited), vn, remaining)
for i in range(n):
    row = []
    for j in range(m):
        if grid[i][j] == '.' and (i,j) in visited:
            row.append('.')
        elif grid[i][j] == '.' and (i,j) not in visited:
            row.append('X')
        else:
            row.append('#')
    print(''.join(row))