Finally it is a day when Arthur has enough money for buying an apartment. He found a great option close to the center of the city with a nice price.

Plan of the apartment found by Arthur looks like a rectangle n × m consisting of squares of size 1 × 1. Each of those squares contains either a wall (such square is denoted by a symbol "*" on the plan) or a free space (such square is denoted on the plan by a symbol ".").

Room in an apartment is a maximal connected area consisting of free squares. Squares are considered adjacent if they share a common side.

The old Arthur dream is to live in an apartment where all rooms are rectangles. He asks you to calculate minimum number of walls you need to remove in order to achieve this goal. After removing a wall from a square it becomes a free square. While removing the walls it is possible that some rooms unite into a single one.

Input

The first line of the input contains two integers n, m (1 ≤ n, m ≤ 2000) denoting the size of the Arthur apartments.

Following n lines each contain m symbols — the plan of the apartment.

If the cell is denoted by a symbol "*" then it contains a wall.

If the cell is denoted by a symbol "." then it this cell is free from walls and also this cell is contained in some of the rooms.

Output

Output n rows each consisting of m symbols that show how the Arthur apartment plan should look like after deleting the minimum number of walls in order to make each room (maximum connected area free from walls) be a rectangle. 

If there are several possible answers, output any of them.

Examples

Input

5 5
.*.*.
*****
.*.*.
*****
.*.*.


Output

.*.*.
*****
.*.*.
*****
.*.*.


Input

6 7
***.*.*
..*.*.*
*.*.*.*
*.*.*.*
..*...*
*******


Output

***...*
..*...*
..*...*
..*...*
..*...*
*******


Input

4 5
.....
.....
..***
..*..


Output

.....
.....
.....
.....
#include <bits/stdc++.h>
using namespace std;
int n, m;
char g[2005][2005];
bool check(int x, int y) {
  if (g[x][y] == '.' || x < 0 || y < 0 || x >= n || y >= m) return 0;
  if (g[x][y - 1] == '.' && g[x - 1][y - 1] == '.' && g[x - 1][y] == '.')
    return 1;
  if (g[x - 1][y] == '.' && g[x - 1][y + 1] == '.' && g[x][y + 1] == '.')
    return 1;
  if (g[x][y + 1] == '.' && g[x + 1][y + 1] == '.' && g[x + 1][y] == '.')
    return 1;
  if (g[x][y - 1] == '.' && g[x + 1][y - 1] == '.' && g[x + 1][y] == '.')
    return 1;
  return 0;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 0; i < n; i++) scanf("%s", g[i]);
    queue<pair<int, int> > q;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (check(i, j)) q.push(pair<int, int>(i, j));
    while (!q.empty()) {
      pair<int, int> u = q.front();
      q.pop();
      int i = u.first, j = u.second;
      if (!check(i, j)) continue;
      g[i][j] = '.';
      for (int x = -2; x <= 2; x++)
        for (int y = -2; y <= 2; y++)
          if ((x || y) && check(i + x, j + y))
            q.push(pair<int, int>(i + x, j + y));
    }
    for (int i = 0; i < n; i++) puts(g[i]);
  }
  return 0;
}
