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.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class A {

	final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok = new StringTokenizer("");

	void solve() throws IOException {
		int n = readInt();
		int m = readInt();
		int k = readInt();
		int s = 0;
		int x = -1;
		int y = -1;
		boolean[][] g = new boolean[n][m];
		for (int i = 0; i < n; i++) {
			char[] c = readString().toCharArray();
			for (int j = 0; j < m; j++) {
				g[i][j] = c[j] != '#';
				if (g[i][j]) s++;
				if (g[i][j] && x == -1) {
					x = i;
					y = j;
				}
			}
		}
		k = s - k;

		if (k == 0) {
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					if(!g[i][j]) out.print('#');
					else out.print('X');
				}
				out.println();
			}
			return;
		}


		boolean[][] res = new boolean[n][m];
		boolean[][] res1 = new boolean[n][m];
		Queue<Integer> xs = new LinkedList<Integer>();
		Queue<Integer> ys = new LinkedList<Integer>();
		res[x][y] = true;
		xs.add(x);
		ys.add(y);

		int cur = 0;
		while (cur < k) {
			int curX = xs.poll();
			int curY = ys.poll();
			res1[curX][curY] = true;
			cur++;
			for (int step = 0; step < 4; step++) {
				int nextX = curX + steps[step][0];
				int nextY = curY + steps[step][1];
				if (nextX >= n || nextX < 0 || nextY >= m || nextY < 0) {
					continue;
				}
				if (!res[nextX][nextY] && g[nextX][nextY]) {
					res[nextX][nextY] = true;
					xs.add(nextX);
					ys.add(nextY);
				}
			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (res1[i][j]) {
					out.print('.');
				} else {
					if (!g[i][j]) {
						out.print('#');
					} else {
						out.print('X');
					}
				}
			}
			out.println();
		}
	}

	int[][] steps = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};

	void init() throws FileNotFoundException {
		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}
	}

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	int[] readArr(int n) throws IOException {
		int[] res = new int[n];
		for (int i = 0; i < n; i++) {
			res[i] = readInt();
		}
		return res;
	}

	long[] readArrL(int n) throws IOException {
		long[] res = new long[n];
		for (int i = 0; i < n; i++) {
			res[i] = readLong();
		}
		return res;
	}

	public static void main(String[] args) {
		new A().run();
	}

	public void run() {
		try {
			long t1 = System.currentTimeMillis();
			init();
			solve();
			out.close();
			long t2 = System.currentTimeMillis();
			System.err.println("Time = " + (t2 - t1));
		} catch (Exception e) {
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}
}