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.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

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

class TaskA {
    /////////////////////////////////////////////////////////////
          static int[][] A;
    static boolean[][] vis;
    static int h, w;
    static int[] dx = {0, 0, +1, -1};
    static int[] dy = {-1, 1, 0, 0};
    boolean inR(int i, int j) {
        return i > -1 && j > -1 && i < h && j < w;
    }
    static int k;
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        h=in.nextInt();w=in.nextInt();k=in.nextInt();
     A=new int[h][w];
        vis= new boolean[h][w];
        for (int i = 0; i < h; i++) {
            String S=in.next();
            for (int j = 0; j < w; j++) {
               if(S.charAt(j)=='.')
                A[i][j]=1;
            }      }
        int chk=0;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
               if(A[i][j]==1){go(i,j);

                   chk=1;
                   break;
               }
            }  if(chk==1)break;
        }


            String[] ret= new String[h];
            for (int i = 0; i < h; i++) {
                StringBuilder sb= new StringBuilder();
                for (int j = 0; j < w; j++) {
                    if(A[i][j]==0)
                        sb.append('#') ;
                    else if(A[i][j]==1)
                        sb.append('.');
                    else
                        sb.append('X');
                }
                ret[i]=sb.toString();
            }
        for (int i = 0; i < h; i++) {
            out.println(ret[i]);
        }
    }
    int go(int i, int j) {
        if (vis[i][j]) return 0;
        vis[i][j] = true;
       int ct=0;
        for (int k = 0; k < 4; k++) {
            int xx = i + dx[k], yy = j + dy[k];
            if (inR(xx, yy) && !vis[xx][yy] && A[xx][yy] == 1){

               ct+=go(xx, yy);  }
        }
      if(ct>0){
          return 1;
      }
      else {
          if(k>0){
              k--;
              A[i][j]=-1;
          }
          return 0;
      }

    }

}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public String next() {
        StringBuilder sb = new StringBuilder();
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        if (c < 0) {
            return null;
        }
        while (c >= 0 && !isWhiteSpace(c)) {
            sb.appendCodePoint(c);
            c = read();
        }
        return sb.toString();
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }


}