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:
# Author : nitish420 --------------------------------------------------------------------
import os
import sys
from io import BytesIO, IOBase



def main():
    n,m,k=map(int,input().split())
    arr=[]

    for _ in range(n):
        arr.append(list(input()))

    s=0

    if k==0:
        for item in arr:
            print(*item,sep="")
        exit()
    stack=[]
    flag=1
    for r in range(n):
        for c in range(m):
            if arr[r][c]=='.' and flag:
                stack.append((r,c))
                flag=0
                s+=1
            elif arr[r][c]=='.':
                s+=1
    s-=k
    visited=set()


    while stack:
        # print(stack)
        z=stack.pop()

        if z in visited:
            # print("YEs")
            continue
        
        visited.add(z)

        if s:
            s-=1
        else:
            arr[z[0]][z[1]]='X'

        r,c=z[0],z[1]

        try:
            if arr[r-1][c]=='.' and r>0:
                stack.append((r-1,c))
        except:
            pass
        try:
            if arr[r+1][c]=='.' and r<n-1:
                stack.append((r+1,c))
        except:
            pass
        try:
            if arr[r][c-1]=='.' and c>0:
                stack.append((r,c-1))
        except:
            pass
        try:
            if arr[r][c+1]=='.' and c<m-1:
                stack.append((r,c+1))
        except:
            pass
    for item in arr:
        print(*item,sep="")
        




    



    
    


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = 'x' in file.mode or 'r' not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b'\n') + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode('ascii'))
        self.read = lambda: self.buffer.read().decode('ascii')
        self.readline = lambda: self.buffer.readline().decode('ascii')


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')



# endregion

if __name__ == '__main__':
    main()