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;
const long long INF64 = 1e18;
const int INF = 1e9;
template <typename T>
void read(vector<T>& v) {
  int n = v.size();
  for (int i = 0; i < n; i++) cin >> v[i];
}
long long ceil(long long a, long long b) {
  long long ans = a / b;
  if (a % b) ans++;
  return ans;
}
long double log(long double a, long double b) { return log(b) / log(a); }
long long power(long long base, long long exp, long long M = LLONG_MAX) {
  long long res = 1;
  while (exp) {
    if (exp % 2 == 1) res = ((res % M) * (base % M)) % M;
    base = ((base % M) * (base % M)) % M;
    exp /= 2;
  }
  return res;
}
string to_base(int n, int new_base) {
  string s;
  int nn = n;
  while (nn) {
    s += to_string(nn % new_base);
    nn /= new_base;
  }
  reverse(s.begin(), s.end());
  return s;
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long x = (a / gcd(a, b));
  return b * x;
}
vector<bool> SIEVE(int n) {
  vector<bool> ans(n + 1);
  for (int i = 2; i <= n; i++) ans[i] = 1;
  for (int i = 2; i * i <= n; i++) {
    if (ans[i])
      for (int j = 2 * i; j <= n; j += i) ans[j] = 0;
  }
  return ans;
}
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
vector<string> a;
int n, m, k;
vector<string> b;
int l = 0;
void dfs(int i, int j) {
  if (i < 0 || j < 0 || n <= i || m <= j || !l || b[i][j] != '.') return;
  b[i][j] = 'S';
  vector<int> d = {-1, 0, 1};
  l--;
  for (int dx : d)
    for (int dy : d)
      if ((dx == 0) ^ (dy == 0)) dfs(i + dx, j + dy);
}
void solve() {
  cin >> n >> m >> k;
  b = vector<string>(n);
  a = vector<string>(n);
  read(a);
  int s = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] == '.') s++;
  bool brk = 0;
  for (int i = 0; i < n; i++) b[i] = a[i];
  l = s - k;
  for (int i = 0; i < n; i++) {
    if (brk) break;
    for (int j = 0; j < m; j++)
      if (a[i][j] == '.') {
        dfs(i, j);
        brk = 1;
        break;
      }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      if (b[i][j] == 'S')
        cout << ".";
      else if (b[i][j] == '.')
        cout << "X";
      else
        cout << b[i][j];
    cout << "\n";
  }
}