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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[1000000];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int color[1000000], countt = 0, mat[509][509], cell[509][509];
queue<int> Q;
void bfs(int s, int pp) {
  int a, d, f, g, h, j, k, l;
  Q.push(s);
  color[s] = 1;
  countt++;
  if (countt == pp) return;
  while (!Q.empty()) {
    d = Q.front();
    Q.pop();
    for (a = 0; a < adj[d].size(); a++) {
      if (color[adj[d][a]] == 0) {
        color[adj[d][a]] = 1;
        Q.push(adj[d][a]);
        countt++;
        if (countt == pp) return;
      }
    }
  }
}
int main() {
  int a, s, f, g, h, j, k, l, mp = 0, pp, index = 1, d, p = 0, source;
  char ch;
  cin >> a >> s >> d;
  for (f = 1; f <= a; f++) {
    for (g = 1; g <= s; g++) {
      color[index] = 0;
      cin >> ch;
      if (p == 0 && ch == '.') {
        source = index;
        p = 1;
      }
      if (ch == '.') {
        mat[f][g] = 1;
        mp++;
      } else
        mat[f][g] = 0;
      cell[f][g] = index;
      index++;
    }
  }
  for (f = 1; f <= a; f++) {
    for (g = 1; g <= s; g++) {
      if (mat[f][g]) {
        for (h = 0; h < 4; h++) {
          if (f + dx[h] >= 1 && f + dx[h] <= a && g + dy[h] >= 1 &&
              g + dy[h] <= s) {
            if (mat[f + dx[h]][g + dy[h]]) {
              j = cell[f][g];
              k = cell[f + dx[h]][g + dy[h]];
              adj[j].push_back(k);
              adj[k].push_back(j);
            }
          }
        }
      }
    }
  }
  pp = mp - d;
  bfs(source, pp);
  index = 1;
  for (f = 1; f <= a; f++) {
    for (g = 1; g <= s; g++) {
      if (mat[f][g] == 0)
        cout << "#";
      else {
        if (color[index] == 1)
          cout << ".";
        else
          cout << "X";
      }
      index++;
    }
    cout << endl;
  }
  cout << endl;
  return 0;
}