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;
inline void _() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
void __() {}
inline void ___(char *i, char *j) {
  freopen(i, "r", stdin);
  freopen(j, "w", stdout);
}
template <class T1>
bool tk(T1 &e1) {
  if (cin >> e1) return true;
  return false;
}
template <class T1, class T2>
bool tk(T1 &e1, T2 &e2) {
  if (cin >> e1 >> e2) return true;
  return false;
}
template <class T1, class T2, class T3>
bool tk(T1 &e1, T2 &e2, T3 &e3) {
  if (cin >> e1 >> e2 >> e3) return true;
  return false;
}
template <class T1, class T2, class T3, class T4>
bool tk(T1 &e1, T2 &e2, T3 &e3, T4 &e4) {
  if (cin >> e1 >> e2 >> e3 >> e4) return true;
  return false;
}
template <class T1, class T2, class T3, class T4, class T5>
bool tk(T1 &e1, T2 &e2, T3 &e3, T4 &e4, T5 &e5) {
  if (cin >> e1 >> e2 >> e3 >> e4 >> e5) return true;
  return false;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
bool tk(T1 &e1, T2 &e2, T3 &e3, T4 &e4, T5 &e5, T6 &e6) {
  if (cin >> e1 >> e2 >> e3 >> e4 >> e5 >> e6) return true;
  return false;
}
template <class T1>
void put(T1 e) {
  cout << e << endl;
}
template <class T1, class T2>
void put(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void put(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void put(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void put(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void put(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
template <class T1>
void putVec(vector<T1> e1) {
  for (int i = 0; i < (e1).size(); i++)
    (!i ? cout << e1[i] : cout << " " << e1[i]);
  cout << endl;
}
template <class T1>
void putArr(T1 arr[], int l) {
  for (int i = 0; i < l; i++) (!i ? cout << arr[i] : cout << " " << arr[i]);
  cout << endl;
}
template <class T1>
void bug(T1 e) {}
template <class T1, class T2>
void bug(T1 e1, T2 e2) {}
template <class T1, class T2, class T3>
void bug(T1 e1, T2 e2, T3 e3) {}
template <class T1, class T2, class T3, class T4>
void bug(T1 e1, T2 e2, T3 e3, T4 e4) {}
template <class T1, class T2, class T3, class T4, class T5>
void bug(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void bug(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {}
template <class T1>
void bugVec(vector<T1> e1) {}
template <class T1>
void bugArr(T1 arr[], int l) {}
template <typename T>
inline bool isOn(T &mask, int pos) {
  return ((mask) & (1 << pos));
}
template <typename T>
inline void setOff(T &mask, int pos) {
  mask = ((mask) & (~(1 << pos)));
}
template <typename T>
inline void setOn(T &mask, int pos) {
  mask = ((mask)(1 << pos));
}
namespace gv {};
long long absolute(long long a) {
  if (a < 0) return -a;
  return a;
}
string s[505];
int v[505][505], n, m, k, t;
int dx[] = {0, 0, -1, 1};
int dy[] = {-1, 1, 0, 0};
int depth;
void dfs(int x, int y) {
  if (x < 0 || y < 0 || x >= n || y >= m || s[x][y] == '#' || s[x][y] == 'X' ||
      v[x][y])
    return;
  depth++;
  v[x][y] = 1;
  if (depth > (t - k)) v[x][y] = 2;
  for (int i = 0; i < 4; i++) {
    dfs(x + dx[i], y + dy[i]);
  }
}
int main() {
  _();
  int sx, sy;
  tk(n, m, k);
  for (int i = 0; i < n; i++) {
    tk(s[i]);
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '.') t++, sx = i, sy = j;
    }
  }
  dfs(sx, sy);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (v[i][j] == 2)
        cout << 'X';
      else
        cout << s[i][j];
    }
    put("");
  }
  __();
}