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:
class Queue:
    def __init__(self):
        self.list = []

    def push(self, value):
        self.list.append(value)

    def pop(self):
        return self.list.pop(0)

    def top(self):
        return self.list[0]

    def empty(self):
        return len(self.list) == 0



class Cell:
    def __init__(self, row, column):
        self.row = row
        self.column = column
    def neighbors(self):
        return [Cell(self.row + 1, self.column    ), # South
                Cell(self.row - 1, self.column    ), # North
                Cell(self.row    , self.column + 1), # West
                Cell(self.row    , self.column - 1)] # East



# data = list(input().split())
# rows = int(data[0])
# columns = int(data[1])
# k = int(data[2])
rows, columns, k = map(int, input().split())
# print(rows)
# print(columns)
# print(k)

#matrix = [[ '#' for i in range(2 + columns)] for j in range(2 + rows)]
top_row = ''.join(['#' for i in range(2 + columns)])
bottom_row = ''.join(['#' for i in range(2 + columns)])


matrix = [top_row] \
       + ['#' + input() + '#' for i in range(rows)] \
       + [bottom_row]
matrix = [list(i) for i in matrix]

# print('\n'.join(matrix))
# matrix = []
# for i in range(rows):
#     matrix.append(input())

emptyCellNum = 0
firstEmptyCell = False
for i in range(rows):
    #row = list(input())
    for j in range(columns):
        #matrix[i+1][j+1] = row[j]
        if matrix[i+1][j+1] == '.':
            emptyCellNum += 1
            if not firstEmptyCell:
                startCell = Cell(i+1, j+1)
                firstEmptyCell = True


# Number of neighrbors that the vertex has
degree = [[0 for i in range(2 + columns)] for j in range(2 + rows)]

visited = [[False for i in range(2 + columns)] for j in range(2 + rows)]



def BFS(start):
    counter = 1
    q = Queue()
    q.push(start)
    visited[start.row][start.column]=True
    while not q.empty():
        cell = q.pop()
        for neighbor in cell.neighbors():
            if matrix[neighbor.row][neighbor.column] == '.':
                if not visited[neighbor.row][neighbor.column]:
                    if counter == emptyCellNum - k:
                        return
                    visited[neighbor.row][neighbor.column]= True
                    counter += 1
                    q.push(neighbor)

BFS(startCell)

for i in range(1, 1 + rows):
    for j in range(1, 1 + columns):
        if matrix[i][j] == '.' and visited[i][j] == False:
            matrix[i][j] = 'X'
#         print(matrix[i][j], end = "")
#     print()


for i in range(2 + rows):
    matrix[i] = ''.join(matrix[i][1:-1])
print("\n".join(matrix[1:-1]))