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 DR[4] = {-1, 0, 0, +1};
const int DC[4] = {0, -1, +1, 0};
class UnionFind {
  vector<pair<int, int> > pr;

 public:
  UnionFind(int nodes) {
    pr.reserve(nodes);
    for (int n = 0; n < int(nodes); ++n) pr.push_back(make_pair(n, 1));
  }
  bool combine(int u, int v) {
    if ((u = find(u)) != (v = find(v))) {
      if (pr[u].second < pr[v].second) swap(u, v);
      pr[u].second += pr[v].second;
      pr[v].first = u;
      return true;
    }
    return false;
  }
  int find(int v) {
    if (pr[v].first == v) return v;
    return pr[v].first = find(pr[v].first);
  }
  int size(int v) { return pr[find(v)].second; }
  int count() {
    int res = 0;
    for (int i = 0; i < (int)pr.size(); ++i) {
      if (pr[i].first == i) ++res;
    }
    return res;
  }
};
static int H, W;
vector<vector<char> > visited;
int find_adjacent(const vector<vector<int> > &input,
                  const vector<vector<int> > &output, int r, int c) {
  visited[r][c] = true;
  int res = 0;
  for (int d = 0; d < int(4); ++d) {
    int nr = r + DR[d], nc = c + DC[d];
    if (input[nr][nc] == input[r][c] && !visited[nr][nc]) {
      res |= find_adjacent(input, output, nr, nc);
    }
    if (output[nr][nc] >= 0) res |= (1 << output[nr][nc]);
  }
  visited[r][c] = false;
  return res;
}
void place_recursive(const vector<vector<int> > &input,
                     vector<vector<int> > &output, int r, int c, int digit) {
  output[r][c] = digit;
  for (int d = 0; d < int(4); ++d) {
    int nr = r + DR[d], nc = c + DC[d];
    if (input[nr][nc] == input[r][c] && output[nr][nc] < 0)
      place_recursive(input, output, nr, nc, digit);
  }
}
void place(const vector<vector<int> > &input, vector<vector<int> > &output,
           int r, int c) {
  int adj = find_adjacent(input, output, r, c);
  int digit = 0;
  while (adj & (1 << digit)) ++digit;
  assert(digit < 10);
  place_recursive(input, output, r, c, digit);
}
int main() {
  cin >> H >> W;
  vector<vector<int> > grid(H + 2, vector<int>(W + 2, -1));
  int grp = 0;
  for (int i = 0; i < int(H); ++i) {
    string line;
    cin >> line;
    for (int j = 0; j < int(W); ++j)
      grid[i + 1][j + 1] = line[j] == '.' ? grp++ : -1;
  }
  UnionFind uf(grp);
  for (int r = 1; r <= int(H); ++r)
    for (int c = 1; c <= int(W); ++c)
      if (grid[r][c] >= 0 && uf.size(grid[r][c]) == 1) {
        int best_g = -1, best_s = 5;
        for (int d = 0; d < int(4); ++d) {
          int nr = r + DR[d], nc = c + DC[d];
          if (grid[nr][nc] >= 0) {
            int g = grid[nr][nc];
            int s = uf.size(g);
            if (s > 0 && s < best_s) {
              best_g = g;
              best_s = s;
            }
          }
        }
        if (best_g < 0) {
          std::cout << -1 << endl;
          return 0;
        }
        uf.combine(grid[r][c], best_g);
      }
  vector<vector<char> >(H + 2, vector<char>(W + 2, 0)).swap(visited);
  vector<vector<int> > output(H + 2, vector<int>(W + 2, -1));
  for (int r = 1; r <= int(H); ++r)
    for (int c = 1; c <= int(W); ++c)
      if (grid[r][c] >= 0) grid[r][c] = uf.find(grid[r][c]);
  for (int r = 1; r <= int(H); ++r)
    for (int c = 1; c <= int(W); ++c)
      if (grid[r][c] >= 0 && output[r][c] < 0) place(grid, output, r, c);
  for (int r = 1; r <= int(H); ++r) {
    for (int c = 1; c <= int(W); ++c)
      cout << (output[r][c] < 0 ? '#' : char('0' + output[r][c]));
    cout << '\n';
  }
}