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;
template <typename T>
inline string toString(T a) {
  ostringstream os("");
  os << a;
  return os.str();
}
template <typename T>
inline long long toLong(T a) {
  long long res;
  istringstream os(a);
  os >> res;
  return res;
}
template <typename T>
inline int toInt(T a) {
  int res;
  istringstream os(a);
  os >> res;
  return res;
}
template <typename T>
inline double toDouble(T a) {
  double res;
  istringstream os(a);
  os >> res;
  return res;
}
template <typename T>
inline T SQ(T a) {
  return a * a;
}
template <typename T>
inline T GCD(T a, T b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
template <typename T>
inline T LCM(T a, T b) {
  long long res = a * b;
  res /= GCD(a, b);
  return res;
}
template <typename T>
inline unsigned long long BIGMOD(T a, T b, T m) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return SQ(BIGMOD(a, b / 2, m)) % m;
  else
    return (a % m * BIGMOD(a, b - 1, m)) % m;
}
template <typename T>
inline vector<string> PARSE(T str) {
  vector<string> res;
  string s;
  istringstream os(str);
  while (os >> s) res.push_back(s);
  return res;
}
template <typename T>
inline unsigned long long DIST(T A, T B) {
  unsigned long long res =
      (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
  return res;
}
template <typename T>
inline long long CROSS(T A, T B, T C) {
  return (B.x - A.x) * (C.y - A.y) - (C.x - A.x) * (B.y - A.y);
}
template <typename T>
inline double cosAngle(T a, T b, T c) {
  double res = a * a + b * b - c * c;
  res = res / (2 * a * b);
  res = acos(res);
  return res;
}
template <typename T>
inline T POWER(T base, int po) {
  T res = 1;
  if (base == 0) return 0;
  for (int i = (0); i < (po); i++) res *= base;
  return res;
}
template <typename T>
inline bool IS_ON(T mask, T pos) {
  return mask & (1 << pos);
}
template <typename T>
inline int OFF(T mask, T pos) {
  return mask ^ (1 << pos);
}
template <typename T>
inline int ON(T mask, T pos) {
  return mask | (1 << pos);
}
template <typename T>
inline void PRINT_GRID(T GRID, int ro, int clm) {
  cout << "GRID"
       << ": " << GRID << endl;
  for (int i = (0); i < (ro); i++) {
    for (int j = (0); j < (clm); j++) cout << GRID[i][j] << " ";
    puts("");
  }
}
int dx[] = {0, 0, 1, -1};
int dy[] = {-1, 1, 0, 0};
char arr[505][505];
int vis[505][505];
int m, n, a;
int ok;
inline bool INSIDE_GRID(int R, int C, int ro, int clm) {
  if (R >= 0 && C >= 0 && R < ro && C < clm) return 1;
  return 0;
}
void dfs(int r, int c) {
  ok--;
  vis[r][c] = 1;
  for (int i = (0); i < (4); i++)
    if (ok && INSIDE_GRID(r + dx[i], c + dy[i], m, n) &&
        arr[r + dx[i]][c + dy[i]] == '.' && vis[r + dx[i]][c + dy[i]] == 0) {
      dfs(r + dx[i], c + dy[i]);
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  ;
  cin >> m >> n >> a;
  ok = 0;
  for (int i = (0); i < (m); i++) {
    cin >> arr[i];
    for (int j = (0); j < (n); j++)
      if (arr[i][j] == '.') ok++;
  }
  ok -= a;
  for (int i = (0); i < (m); i++)
    for (int j = (0); j < (n); j++)
      if (ok && arr[i][j] == '.' && !vis[i][j]) {
        dfs(i, j);
      }
  for (int i = (0); i < (m); i++) {
    for (int j = (0); j < (n); j++) {
      if (arr[i][j] == '.' && vis[i][j] == 0 && a)
        cout << "X", a--;
      else
        cout << arr[i][j];
    }
    cout << endl;
  }
  return 0;
}