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 mod = 1000000007;
const long long inf = 92233720368547758;
bool isprime(long long n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
long long fpow(long long a, long long b) {
  return b ? fpow(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long inv(long long i) {
  if (i == 1) return 1;
  return (mod - ((mod / i) * inv(mod % i)) % mod) % mod;
}
long long dtb(long long x) {
  long long ans = 0;
  long long y = 1;
  while (x > 0) {
    ans += (x % 2) * y;
    x = x / 2;
    y = y * 10;
  }
  return ans;
}
vector<long long> adj[300009], vis(500009, 0), adjr[100009], col(200009, 0);
bool cmp(string x, string y) { return x.size() < y.size(); }
void solve() {
  int n, m, k, cnt = 0;
  cin >> n >> m >> k;
  char a[n + 2][m + 2];
  int x, y;
  for (int i = 0; i <= n + 1; i++) {
    for (int j = 0; j <= m + 1; j++) {
      a[i][j] = '#';
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
      if (a[i][j] == '.') {
        cnt++;
        x = i;
        y = j;
      }
    }
  }
  queue<pair<int, int>> q;
  map<pair<int, int>, int> make_pair;
  q.push({x, y});
  make_pair[{x, y}] = 1;
  while (!q.empty()) {
    pair<int, int> curr = q.front();
    q.pop();
    cnt--;
    int p = curr.first;
    int r = curr.second;
    if (cnt < k) a[p][r] = 'X';
    if (make_pair[{p + 1, r}] == 0 and a[p + 1][r] == '.') {
      q.push({p + 1, r});
      make_pair[{p + 1, r}] = 1;
    }
    if (make_pair[{p - 1, r}] == 0 and a[p - 1][r] == '.') {
      q.push({p - 1, r});
      make_pair[{p - 1, r}] = 1;
    }
    if (make_pair[{p, r - 1}] == 0 and a[p][r - 1] == '.') {
      q.push({p, r - 1});
      make_pair[{p, r - 1}] = 1;
    }
    if (make_pair[{p, r + 1}] == 0 and a[p][r + 1] == '.') {
      q.push({p, r + 1});
      make_pair[{p, r + 1}] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << a[i][j];
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  auto start = std::chrono::high_resolution_clock::now();
  long long T = 1;
  while (T--) {
    solve();
  }
  auto stop = std::chrono::high_resolution_clock::now();
  auto duration =
      std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
}