Problem: Physicist Woll likes to play one relaxing game in between his search of the theory of everything.

Game interface consists of a rectangular n × m playing field and a dashboard. Initially some cells of the playing field are filled while others are empty. Dashboard contains images of all various connected (we mean connectivity by side) figures of 2, 3, 4 and 5 cells, with all their rotations and reflections. Player can copy any figure from the dashboard and place it anywhere at the still empty cells of the playing field. Of course any figure can be used as many times as needed.

Woll's aim is to fill the whole field in such a way that there are no empty cells left, and also... just have some fun.

Every initially empty cell should be filled with exactly one cell of some figure. Every figure should be entirely inside the board.

<image>

In the picture black cells stand for initially filled cells of the field, and one-colour regions represent the figures.

Input

First line contains integers n and m (1 ≤ n, m ≤ 1000) — the height and the width of the field correspondingly. Next n lines contain m symbols each. They represent the field in a natural way: j-th character of the i-th line is "#" if the corresponding cell is filled, and "." if it is empty.

Output

If there is no chance to win the game output the only number "-1" (without the quotes). Otherwise output any filling of the field by the figures in the following format: each figure should be represented by some digit and figures that touch each other by side should be represented by distinct digits. Every initially filled cell should be represented by "#".

Examples

Input

2 3
...
#.#


Output

000
#0#


Input

3 3
.#.
...
..#


Output

5#1
511
55#


Input

3 3
...
.##
.#.


Output

-1


Input

1 2
##


Output

##

Note

In the third sample, there is no way to fill a cell with no empty neighbours.

In the forth sample, Woll does not have to fill anything, so we should output the field from the input.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
char buf[1100][1100];
int cr[1100000];
int cc[1100000];
int dr[4] = {-1, 1, 0, 0};
int dc[4] = {0, 0, -1, 1};
int fid[1100][1100];
bool pos[11];
bool vis1[1100][1100];
bool vis2[1100][1100];
int main() {
  memset(fid, -1, sizeof(fid));
  memset(vis1, false, sizeof(vis1));
  memset(vis2, false, sizeof(vis2));
  int R, C, N = 0;
  scanf("%d%d", &R, &C);
  for (int i = (0); i < (R); i++) scanf("%s", buf[i]);
  for (int r = (0); r < (R); r++)
    for (int c = (0); c < (C); c++)
      if (buf[r][c] == '.' && fid[r][c] == -1) {
        if (r + 1 < R && buf[r + 1][c] != '#') {
          if (fid[r + 1][c] == -1) {
            cr[N] = r;
            cc[N] = c;
            fid[r][c] = N++;
            fid[r + 1][c] = fid[r][c];
          } else {
            fid[r][c] = fid[r + 1][c];
          }
          continue;
        }
        if (c + 1 < C && buf[r][c + 1] != '#') {
          if (fid[r][c + 1] == -1) {
            cr[N] = r;
            cc[N] = c;
            fid[r][c] = N++;
            fid[r][c + 1] = fid[r][c];
          } else {
            fid[r][c] = fid[r][c + 1];
          }
          continue;
        }
        if (r > 0 && buf[r - 1][c] != '#') {
          fid[r][c] = fid[r - 1][c];
          continue;
        }
        if (c > 0 && buf[r][c - 1] != '#') {
          fid[r][c] = fid[r][c - 1];
          continue;
        }
        printf("-1\n");
        return 0;
      }
  for (int i = (0); i < (N); i++) {
    memset(pos, 0, sizeof(pos));
    queue<pair<int, int> > q = queue<pair<int, int> >();
    queue<pair<int, int> > q2 = queue<pair<int, int> >();
    q.push(pair<int, int>(cr[i], cc[i]));
    vis1[cr[i]][cc[i]] = true;
    while (!q.empty()) {
      pair<int, int> nn = q.front();
      q2.push(nn);
      q.pop();
      int r = nn.first, c = nn.second;
      for (int d = (0); d < (4); d++) {
        int rr = r + dr[d], cc = c + dc[d];
        if (rr < 0 || cc < 0 || rr == R || cc == C) continue;
        if (fid[rr][cc] == i) {
          if (!vis1[rr][cc]) {
            vis1[rr][cc] = true;
            q.push(pair<int, int>(rr, cc));
          }
        } else {
          if (buf[rr][cc] >= '0' && buf[rr][cc] <= '9') {
            pos[buf[rr][cc] - '0'] = true;
          }
        }
      }
    }
    int uc = 0;
    while (pos[uc]) ++uc;
    char sc = '0' + uc;
    while (!q2.empty()) {
      buf[q2.front().first][q2.front().second] = sc;
      q2.pop();
    }
  }
  for (int i = (0); i < (R); i++) printf("%s\n", buf[i]);
  return 0;
}