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 MAXN = 1024;
static int curid = 0;
int id[MAXN][MAXN];
char buf[MAXN][MAXN];
struct Node {
  const int x, y;
  vector<Node*> p;
  bool ok[6];
  int how[6][4];
  Node(int x, int y) : x(x), y(y) {}
  int getok() const {
    for (int i = 2; i <= 5; ++i) {
      if (ok[i]) {
        return i;
      }
    }
    return -1;
  }
  void gao() {
    vector<int> ok(6, false);
    static int how[2][6][4];
    ok[1] = true;
    int from = 0, to = 1;
    for (int i = 0; i < (int)p.size(); ++i) {
      swap(from, to);
      vector<int> ok0(6, false);
      ok.swap(ok0);
      for (int j = 1; j <= 5; ++j) {
        if (ok0[j] && p[i]->getok() != -1) {
          ok[j] = true;
          copy(how[from][j], how[from][j] + i, how[to][j]);
          how[to][j][i] = 0;
        }
        for (int k = 1; !ok[j] && k < j; ++k) {
          if (ok0[j - k] && p[i]->ok[k]) {
            ok[j] = true;
            copy(how[from][j - k], how[from][j - k] + i, how[to][j]);
            how[to][j][i] = k;
          }
        }
      }
    }
    copy(ok.begin(), ok.end(), this->ok);
    for (int i = 1; i <= 5; ++i) {
      if (ok[i]) {
        copy(how[to][i], how[to][i] + p.size(), this->how[i]);
      }
    }
  }
  void debug(int lv = 0) {
    for (int lvi = 0; lvi < lv; ++lvi) {
      printf("\t");
    }
    printf("(%d, %d) ", x, y);
    for (int i = 1; i <= 5; ++i) {
      putchar(ok[i] ? 'Y' : 'N');
    }
    puts("");
    for (int i = 0; i < (int)p.size(); ++i) {
      p[i]->debug(lv + 1);
    }
  }
};
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
Node* floodfill(int i, int j) {
  Node* p = new Node(i, j);
  queue<Node*> q;
  stack<Node*> s;
  buf[p->x][p->y] = 'x';
  q.push(p);
  s.push(p);
  while (!q.empty()) {
    Node* t = q.front();
    q.pop();
    for (int k = 0; k < 4; ++k) {
      i = t->x + dx[k];
      j = t->y + dy[k];
      if (buf[i][j] == '.') {
        buf[i][j] = 'x';
        Node* r = new Node(i, j);
        t->p.push_back(r);
        q.push(r);
        s.push(r);
      }
    }
  }
  while (!s.empty()) {
    Node* t = s.top();
    s.pop();
    t->gao();
  }
  return p;
}
void dump(Node* p) {
  queue<pair<Node*, pair<int, int> > > q;
  q.push(make_pair(p, make_pair(0, -1)));
  while (!q.empty()) {
    p = q.front().first;
    int s = q.front().second.first;
    int d = q.front().second.second;
    q.pop();
    if (s == 0) {
      s = p->getok();
      d = curid++;
    }
    id[p->x][p->y] = d;
    for (int i = 0; i < (int)p->p.size(); ++i) {
      q.push(make_pair(p->p[i], make_pair(p->how[s][i], d)));
    }
  }
}
void color(int i, int j) {
  vector<pair<int, int> > v;
  set<char> s;
  int d = id[i][j];
  id[i][j] = -1;
  v.push_back(make_pair(i, j));
  for (int h = 0; h < (int)v.size(); ++h) {
    i = v[h].first;
    j = v[h].second;
    for (int k = 0; k < 4; ++k) {
      int x = i + dx[k];
      int y = j + dy[k];
      if (id[x][y] == d) {
        id[x][y] = -1;
        v.push_back(make_pair(x, y));
      } else if (isdigit(buf[x][y])) {
        s.insert(buf[x][y]);
      }
    }
  }
  char c;
  for (c = '0'; s.count(c) > 0; ++c) {
  }
  for (int h = 0; h < (int)v.size(); ++h) {
    buf[v[h].first][v[h].second] = c;
  }
}
int main() {
  int r, c;
  vector<Node*> p;
  scanf("%d%d", &r, &c);
  memset(id, 0xff, sizeof(id));
  memset(buf, '\0', sizeof(buf));
  for (int i = 1; i <= r; ++i) {
    scanf("%s", buf[i] + 1);
  }
  for (int i = 1; i <= r; ++i) {
    for (int j = 1; j <= c; ++j) {
      if (buf[i][j] == '.') {
        p.push_back(floodfill(i, j));
      }
    }
  }
  for (int i = 0; i < (int)p.size(); ++i) {
    if (p[i]->getok() == -1) {
      puts("-1");
      return 0;
    } else {
      dump(p[i]);
    }
  }
  for (int i = 1; i <= r; ++i) {
    for (int j = 1; j <= c; ++j) {
      if (id[i][j] != -1) {
        color(i, j);
      }
    }
  }
  for (int i = 1; i <= r; ++i) {
    for (int j = 1; j <= c; ++j) {
      putchar(buf[i][j]);
    }
    puts("");
  }
  return 0;
}