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 {

	int n, m, k;
	char[][] map;
	boolean[][] color;

	int[] dx = new int[] { 1, 0, -1, 0 };
	int[] dy = new int[] { 0, 1, 0, -1 };

	void dfs(int x, int y) {
		color[x][y] = true;
		int v = 0;
		for (int d = 0; d < 4; d++) {
			int tx = x + dx[d];
			int ty = y + dy[d];
			if (0 <= tx && tx < n && 0 <= ty && ty < m && map[tx][ty] == '.' && !color[tx][ty]) {
				dfs(tx, ty);
				v++;
			}
		}
		if (v == 0) {
			if (k > 0) {
				map[x][y] = 'X';
				k--;
			}
		} else {
			int u = 0;
			for (int d = 0; d < 4; d++) {
				int tx = x + dx[d];
				int ty = y + dy[d];
				if (0 <= tx && tx < n && 0 <= ty && ty < m && map[tx][ty] == 'X') {
					u++;
				}
			}
			if (u >= v && k > 0) {
				map[x][y] = 'X';
				k--;
			}
		}
	}

	void run() throws IOException {
		n = ni();
		m = ni();
		k = ni();
		map = new char[n][];
		color = new boolean[n][m];

		for (int i = 0; i < n; i++) {
			map[i] = nl().toCharArray();
		}
		boolean d = true;
		for (int i = 0; d && i < n; i++) {
			for (int j = 0; d && j < m; j++) {
				if (map[i][j] == '.' && !color[i][j]) {
					dfs(i, j);
					d = false;
				}
			}
		}

		for (int i = 0; i < n; i++) {
			pw.println(new String(map[i]));
		}
	}

	int[][] nm(int a_len, int a_hei) throws IOException {
		int[][] _a = new int[a_len][a_hei];
		for (int i = 0; i < a_len; i++)
			for (int j = 0; j < a_hei; j++)
				_a[i][j] = ni();
		return _a;
	}

	String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	boolean hasNext() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return false;
			}
			st = new StringTokenizer(line);
		}
		return true;
	}

	int[] na(int a_len) throws IOException {
		int[] _a = new int[a_len];
		for (int i = 0; i < a_len; i++)
			_a[i] = ni();
		return _a;
	}

	int ni() throws IOException {
		return Integer.parseInt(next());
	}

	long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	String nl() throws IOException {
		return br.readLine();
	}

	void tr(String debug) {
		if (!OJ)
			pw.println(" " + debug);
	}

	static PrintWriter pw;
	static BufferedReader br;
	static StringTokenizer st;
	static boolean OJ;

	public static void main(String[] args) throws IOException {
		long timeout = System.currentTimeMillis();
		OJ = System.getProperty("ONLINE_JUDGE") != null;
		pw = new PrintWriter(System.out);
		br = new BufferedReader(OJ ? new InputStreamReader(System.in) : new FileReader(new File("input.txt")));

		if (OJ) {
			new A().run();
		} else {
			while (br.ready()) {
				new A().run();
				pw.println();
			}
			pw.println("----------------------------------");
			pw.println(System.currentTimeMillis() - timeout);
		}
		br.close();
		pw.close();
	}

}