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.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Tmbao
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    char[][] a;
    boolean[][] gone;
    int[] ci = {-1, 1, 0, 0};
    int[] cj = {0, 0, -1, 1};
    int n, m, k, cempty, cgone, limit;

    void dfs(int i, int j) {
        if (cgone == limit) return;
        cgone++;
        gone[i][j] = true;
//      System.out.printf("  %d %d %d\n", i, j, cgone);
        for(int k = 0; k < 4; k++) {
            int ii = i + ci[k];
            int jj = j + cj[k];

            if (a[ii][jj] == '.' && !gone[ii][jj])
                dfs(ii, jj);
        }
    }


    public void solve(int testNumber, InputReader in, PrintWriter out) {
        n = in.nextInt();
        m = in.nextInt();
        k = in.nextInt();
        a = new char[n+10][m+10];
        gone = new boolean[n+10][m+10];
        for(int i = 0; i <= n+1; i++)
            for(int j = 0; j <= m+1; j++) {
                a[i][j] = '#';
                gone[i][j] = false;
            }

        cempty = 0;
        int u = 0, v = 0;
        for(int i = 1; i <= n; i++) {
            String line = in.nextLine();
            for(int j = 0; j < line.length(); j++) {
                a[i][j+1] = line.charAt(j);
                if (a[i][j+1] == '.') {
                    u = i;
                    v = j+1;
                    cempty++;
                }
            }
        }

        limit = cempty - k;
        cgone = 0;
//      out.printf("%d %d %d\n", u, v, limit);
        dfs(u, v);

        for(int i = 1; i <= n; i++) {
            for(int j = 1; j <= m; j++) {
                if (a[i][j] == '.' && !gone[i][j])
                    a[i][j] = 'X';
                out.print(a[i][j]);
            }
            out.println();
        }

    }
}

class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer != null) {
            while (tokenizer.hasMoreTokens())
                tokenizer.nextToken();
        }
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

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

    public float nextFloat() {
        return Float.parseFloat(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }

}