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.Arrays;
import java.util.Stack;

public class CF377A {
    static int n, m , k, c = 0;
    static Point t;
    static String ins[], in;
    static char[][] map = new char[505][505];
    static boolean[][] visited = new boolean[505][505];
    static int[] dx = {0, 0, -1, 1};
    static int[] dy = {1, -1, 0, 0};
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        ins = br.readLine().split(" ");
        n = Integer.parseInt(ins[0]);
        m = Integer.parseInt(ins[1]);
        k = Integer.parseInt(ins[2]);
        Arrays.fill(map[0], '#');
        Arrays.fill(map[n + 1], '#');
        for (int i = 1; i <= n; i++) {
            in = br.readLine();
            map[i][0] = '#';map[i][m + 1] = '#';
            for (int j = 1; j <= m; j++) {
                map[i][j] = in.charAt(j - 1);
                if (map[i][j] == '.') {
                    if (t == null) t = new Point(i, j);
                    c++;
                }

            }
        }
        c -= k;
        dfs(t);
        StringBuffer sb = new StringBuffer();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
                if (map[i][j] == '$') sb.append('.');
                else if (map[i][j] == '.') sb.append('X');
                else sb.append(map[i][j]);

            }
            sb.append("\n");
        }
        bw.write(sb.toString());
        bw.flush();bw.close();

    }

//    public static void dfs(Point p) {
//        if (c < 1) return;
//        visited[p.x][p.y] = true;
//        c--; map[p.x][p.y] = '$';
//        for (int i = 0; i < 4; i++) {
//            int nx = p.x + dx[i], ny = p.y + dy[i];
//            if (!visited[nx][ny] && map[nx][ny] == '.') dfs(new Point(nx, ny));
//        }
//    }

    public static void dfs(Point p) {
        Stack<Point> s = new Stack<>();
        s.push(p);
        while (!s.isEmpty()) {
            Point cur = s.pop();
            c--; map[cur.x][cur.y] = '$';
            if (c == 0) break;
            for (int i = 0; i < 4; i++) {
                int nx = cur.x + dx[i], ny = cur.y + dy[i];
                if (!visited[nx][ny] && map[nx][ny] == '.') {
                    visited[nx][ny] = true;
                    s.push(new Point(nx, ny));
                }
            }
        }
    }

    private static class Point {
        int x, y;
        Point(int x, int y) {
            this.x = x; this.y = y;
        }
    }
}