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 JAVA):

Solution:

import java.io.*;
import java.util.*;

public class A {
	
	static int n,m,k;
	static char[][] chart;
	static boolean[][] went;
	static boolean done;
	
	static void expand(int x,int y,int[] left){
		if(chart[x][y]=='#') return;
		done = true;
		went[x][y] = true;
		if(x!=0 && chart[x-1][y]=='.' && !went[x-1][y]) expand(x-1,y,left);
		if(x!=n-1 && chart[x+1][y]=='.' && !went[x+1][y]) expand(x+1,y,left);
		if(y!=0 && chart[x][y-1]=='.' && !went[x][y-1]) expand(x,y-1,left);
		if(y!=m-1 && chart[x][y+1]=='.' && !went[x][y+1]) expand(x,y+1,left);
		if(left[0]>0){
			left[0]--;
			chart[x][y] = 'X';
		}
		//System.out.println(x+" "+y+" "+left[0]+" ");
	}
	
	public static void main(String[] args) {
		Scan scan = new Scan(System.in);
		n = scan.nextInt();
		m = scan.nextInt();
		k = scan.nextInt();
		chart = new char[n][m];
		went = new boolean[n][m];
		done = false;
		for(int i=0;i<n;i++){
			chart[i] = scan.next().toCharArray();
			Arrays.fill(went[i], false);
		}
		for(int i=0;i<n;i++){ 
			for(int j=0;j<m;j++){
				int[] temp = new int[1];
				temp[0] = k;
				expand(i,j,temp);
				if(done) break;
			}
			if(done) break;
		}
		for(int i=0;i<n;i++) System.out.println(chart[i]);
	}



	final static class Scan{
		private InputStream in = null;
		private int pos,count;
		private byte[] buf = new byte[1<<16];
		
		public Scan(InputStream in){
			this.in = in;
			pos = 0;
			count = 0;
		}
		public int nextInt(){
			int c=read(), sign = 1;
			while (c <= ' ')
			    c = read();
			if (c == '-')
			{
				sign = -1;
				c = read();
			}
			int n = c - '0';
			while((c = read() - '0') >= 0)
			    n = n * 10 + c;
			return n * sign;		
		}
		
		public long nextLong(){
			int c = read(), sign = 1;
			while (c <= ' ')
			    c = read();
			if (c == '-')
			{
				sign = -1;
				c = read();
			}
			long n = 1L * (c - '0');
			while((c = read() - '0') >= 0)
			    n = n * 10 + c;
			return n * sign;		
		}
		public String next(){
			StringBuilder sb = new StringBuilder();
			int c = read();
			while (c <= ' ')
			    c = read();
			while (c >= 33)
			{
				sb.append((char) c );
				c = read();
			}
			
			return sb.toString();
		}
		public String nextLine(){
			StringBuilder sb = new StringBuilder();
			int c = read();
			while (c < ' ')
			    c = read();
			while (c >= 32)
			{
				sb.append((char) c );
				c = read();
			}
			
			return sb.toString();
		}
		public char nextChar(){		
			int c = read();
			while (c <= ' ')
			    c = read();
		
			return (char)c;
		}
		public int read(){
			if( pos == count)
			   fillBuffer();
			   
			return buf[pos++];		
		}
		private void fillBuffer(){
			try{
				count = in.read(buf, pos = 0 , buf.length);
				if (count == -1)
					buf[0] = -1;
			}
			catch(Exception e)
			{
			}
		}
	}
}