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;
long long int min(long long int a, long long int b) { return a < b ? a : b; }
long long int min(long long int a, long long int b, long long int c) {
  a = min(a, b);
  a = min(a, c);
  return a;
}
long long int max(long long int a, long long int b) { return a > b ? a : b; }
long long int max(long long int a, long long int b, long long int c) {
  a = max(a, b);
  a = max(a, c);
  return a;
}
long long int dsum(long long int n) {
  long long int ans = 0;
  while (n) {
    ans += (n % 10);
    n /= 10;
  }
  return ans;
}
long long int power(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
struct pll {
  long long int x, y;
};
bool comp(pll a, pll b) {
  if (a.x == b.x)
    return a.y < b.y;
  else
    return a.x < b.x;
}
string ss[505], ss1[505];
long long int n, m, k, s, u;
bool ok;
void input() {
  cin >> n >> m >> k;
  for (long long int i = 0; i < n; i++) cin >> ss[i];
  for (long long int i = 0; i < n; i++) ss1[i] = ss[i];
}
void dfs1(long long int r, long long int c) {
  if (r < 0 || c < 0 || r >= n || c >= m) return;
  if (ss1[r][c] == '#') return;
  s++;
  ss1[r][c] = '#';
  dfs1(r + 1, c);
  dfs1(r - 1, c);
  dfs1(r, c + 1);
  dfs1(r, c - 1);
}
void dfs(long long int r, long long int c) {
  if (r < 0 || c < 0 || r >= n || c >= m) return;
  if (ss[r][c] == '#' || ss[r][c] == 'X' || ss[r][c] == 'P') return;
  s++;
  if (s > u)
    ss[r][c] = 'X';
  else
    ss[r][c] = 'P';
  dfs(r + 1, c);
  dfs(r - 1, c);
  dfs(r, c + 1);
  dfs(r, c - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  char ch;
  double aa, bb, cc;
  string s1, s2, s3, str;
  long long int i, j, a, b, c, d, sum = 0, ans = 0, temp, t;
  input();
  s = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (ss1[i][j] == '.') {
        dfs1(i, j);
      }
    }
  }
  u = s - k;
  s = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (ss[i][j] == '.') {
        dfs(i, j);
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (ss[i][j] == 'P') {
        cout << ".";
      } else if (ss[i][j] == '#') {
        cout << ss[i][j];
      } else {
        cout << "X";
      }
    }
    if (i != n - 1) cout << endl;
  }
  return 0;
}