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.math.BigInteger;
    import java.util.*;

    public class TaskC {

        static Integer[][]dp;
        static int n, m, ans;
        static String s;
        static Stack<Pair> st;
        static char[][]arr;
        static boolean[][]vis;


        static void dfs(int i , int j)
        {
            vis[i][j] = true;
            st.add(new Pair(i , j));
            if( i < n - 1 &&arr[i + 1][j] !='#' && !vis[i + 1][j])
                dfs(i + 1, j);

            if(j < m - 1 && arr[i][j + 1] != '#' && !vis[i][j + 1])
                dfs(i, j + 1);

            if(i > 0 && arr[i - 1][j] != '#' && !vis[i - 1][j])
                dfs(i  - 1,j );
            if(j > 0 && arr[i][j - 1] != '#' && !vis[i][j - 1])
                dfs(i ,j - 1 );

        }


        public static void main(String[] args) throws Exception {

            Scanner sc = new Scanner(System.in);
            PrintWriter pw = new PrintWriter(System.out);

            n = sc.nextInt();
            m = sc.nextInt();
            int k = sc.nextInt();
            arr = new char[n][n];
            int x  = -1,y = -1;
            for (int i = 0 ; i < n ; i++) {
                arr[i] = sc.nextLine().toCharArray();
                for (int j = 0 ; j < m ; j++)
                    if(x== -1 && arr[i][j] == '.') {
                        x = i;
                        y = j;
                    }
            }
            st = new Stack<>();
            vis = new boolean[n][m];
            dfs(x,y);
            while (k-- > 0)
            {
                Pair p = st.pop();
                arr[p.x][p.y] = 'X';
            }
            for (int i = 0 ; i < n ; i ++ ) {
                for (int j = 0; j < m; j++)
                    pw.print(arr[i][j]);
                pw.println();
            }
            pw.close();

        }

        private static long gcd(long a, long b) {
            if( b == 0)
                return a;
            return gcd(b  , a%b);
        }

        static long lcm(int a, int b)
        {
            return (a*b)/gcd(a, b);
        }


        private  static int dis(int xa , int ya , int xb , int yb)
        {
            return (xa-xb)*(xa - xb) + (ya- yb)*(ya-yb);
        }


        static class Pair implements Comparable<Pair> {
            int x,y;


            public Pair(int x, int y) {
                this.x = x;
                this.y = y;
            }

            public int compareTo(Pair o) {
                if (y  == o.y)
                    return o.x - x;
                return y - o.y;

            }
            public double dis(Pair a){

                return (a.x - x)*(a.x - x) + (a.y-y)*(a.y-y);
            }

            public String toString() {
                return  x+" "+ y;
            }
            public boolean overlap(Pair a)
            {
            if((this.x >= a.x && this.x <= a.y) || (a.x >= this.x && a.x <= this.y)) return true;
                return false;

            }
        }

        static class Scanner {
            StringTokenizer st;
            BufferedReader br;

            public Scanner(FileReader r) {
                br = new BufferedReader(r);
            }

            public Scanner(InputStream s) {
                br = new BufferedReader(new InputStreamReader(s));
            }

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

            public boolean check() {
                if (!st.hasMoreTokens())
                    return false;
                return true;
            }

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

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

            public String nextLine() {
                try {
                    return br.readLine();
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }

            public double nextDouble() {
                String x = next();
                StringBuilder sb = new StringBuilder("0");
                double res = 0, f = 1;
                boolean dec = false, neg = false;
                int start = 0;
                if (x.charAt(0) == '-') {
                    neg = true;
                    start++;
                }
                for (int i = start; i < x.length(); i++)
                    if (x.charAt(i) == '.') {
                        res = Long.parseLong(sb.toString());
                        sb = new StringBuilder("0");
                        dec = true;
                    } else {
                        sb.append(x.charAt(i));
                        if (dec)
                            f *= 10;
                    }
                res += Long.parseLong(sb.toString()) / f;
                return res * (neg ? -1 : 1);
            }

            public boolean ready() {
                try {
                    return br.ready();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }