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:
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineerin College
    Date:23/04/2020

'''
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())


abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def powmod(a,b):
    a%=mod
    if(a==0):
        return 0
    res=1
    while(b>0):
        if(b&1):
            res=(res*a)%mod
        a=(a*a)%mod
        b>>=1
    return res
        
def main():
    
    # for _ in range(ii()):
    n,m,k=mi()
    a=[]
    for i in range(n):
        a.append(list(si()))
    vis=[[0 for i in range(505)]for j in range(505)]
    s=0
    for i in range(n):
        for j in range(m):
            if(a[i][j]=="."):
                s+=1
                x=i
                y=j
    s-=k
    if(s>0):
        b=[]
        b.append([x,y])
        c=1
        vis[x][y]=1
        f=0
        # print(s)
        while(len(b)>0):
            x=b[0][0]
            y=b[0][1]
            del b[0]
            for i in range(4):
                x1=x+dx[i]
                y1=y+dy[i]
                if(x1<0 or y1<0 or x1>=n or y1>=m or a[x1][y1]!="." or vis[x1][y1]):
                    continue
                if(c>=s):
                    # print(c)
                    f=1
                    break
                c+=1
                vis[x1][y1]=1
                b.append([x1,y1])
            if(f):
                break
                
        for i in range(n):
            for j in range(m):
                if(a[i][j]=="." and vis[i][j]==0):
                    a[i][j]="X"
                    
    for i in range(n):
        for j in range(m):
            print(a[i][j],end="")
        print()
    












if __name__ == "__main__":
    main()