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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Queue;
import java.util.Random;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Solution implements Runnable {

        public static void main(String[] args) {
                (new Thread(null, new Solution(), "1", (1l << 28))).start();
        }

        BufferedReader in;
        PrintWriter out;
        StringTokenizer st;

        String nextToken() throws IOException {
                while (st == null || !st.hasMoreTokens()) {
                        String r = in.readLine();
                        if (r == null) return null;
                        st = new StringTokenizer(r);
                }
                return st.nextToken();
        }

        int nextInt() throws IOException {
                return Integer.parseInt(nextToken());
        }

        long nextLong() throws IOException {
                return Long.parseLong(nextToken());
        }

        double nextDouble() throws IOException {
                return Double.parseDouble(nextToken());
        }
        
        int n, m;
        char[][] a;
        boolean[][] ww;
        boolean[][][] b;
        int[][] sum;
        int[] dx = {0, -1, 0, 1};
        int[] dy = {-1, 0, 1, 0};
        boolean[] tmp = new boolean[10];
        
        void dfs2(int q, int w) {
                a[q][w] = 'w';
                for (int d = 0; d < 4; d++) {
                        int nx = q + dx[d];
                        int ny = w + dy[d];
                        if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
                        if (a[nx][ny] == 'q') {
                                dfs2(nx, ny);
                        }
                }
                for (int i = 0; i < 10; i++) tmp[i] |= b[q][w][i];
        }
        
        void dfscolor(int q, int w, char color) {
                a[q][w] = color;
                for (int d = 0; d < 4; d++) {
                        int nx = q + dx[d];
                        int ny = w + dy[d];
                        if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
                        b[nx][ny][color - '0'] = true;
                        if (a[nx][ny] == 'w') {
                                dfscolor(nx, ny, color);
                        }
                }
        }

        int dfscheck(int q, int w) {
        	ww[q][w] = true;
            int res = 1;
            for (int d = 0; d < 4; d++) {
                    int nx = q + dx[d];
                    int ny = w + dy[d];
                    if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
                    if (a[nx][ny] == a[q][w] && !ww[nx][ny]) {
                    	res += dfscheck(nx, ny);
                    }
            }
            return res;
        }
        
        int rq, rw;
        
        void qcolor(int nx, int ny) {
            Arrays.fill(tmp, false);
            dfs2(nx, ny);
            int color = 0;
            while (tmp[color]) color++;
            dfscolor(nx, ny, (char)(color + '0'));
        }

        boolean dfs(int q, int w) {
                int cntr = 0;
                int cc = 0;
                a[q][w] = ',';
                int nsx = -1, nsy = -1;
                for (int d = 0; d < 4; d++) {
                        int nx = q + dx[d];
                        int ny = w + dy[d];
                        if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
                        if (a[nx][ny] != '#') cntr++;
                        if (a[nx][ny] == '.') {
                                if (!dfs(nx, ny)) cc++; else {
                                	if (q == rq && w == rw && nsx == -1) {
                                		nsx = nx; nsy = ny;
                                	} else {
                                		qcolor(nx, ny);
                                	}
                                }
                        }
                }
                if (cntr == 0) return false;
                if (cc == 0) {
                	a[q][w] = 'q';
                    if (q != rq || w != rw) {
                    	return false; 
                    }
                }
                if (q == rq && w == rw) {
	                if (nsx != -1) qcolor(nsx, nsy);
	                if (a[q][w] == ',') {
	                	a[q][w] = 'q';
	                	qcolor(q, w);
	                }
                }
                return true;
        }
        
        void solve() throws Exception {
                n = nextInt(); m = nextInt();
                a = new char[n][m];
                b = new boolean[n][m][10];
                sum = new int[n][m];
                for (int i = 0; i < n; i++) {
                        String s = nextToken();
                        for (int j = 0; j < m; j++) {
                                a[i][j] = s.charAt(j);
                        }
                }
                for (int i = 0; i < n; i++) {
                        for (int j = 0; j < m; j++) {
                                if (a[i][j] == '.') {
                                		rq = i; rw = j;
                                        if (!dfs(i, j)) {
                                                out.println(-1);
                                                return;
                                        } else {
                                                if (a[i][j] == 'q') {
                                                        for (int d = 0; d < 4; d++) {
                                                                int nx = i + dx[d];
                                                                int ny = j + dy[d];
                                                                if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
                                                                if (a[nx][ny] != '#') {
                                                                        a[i][j] = a[nx][ny];
                                                                        break;
                                                                }
                                                        }
                                                }
                                        }
                                }
                        }
                }
                ww = new boolean[n][m];
                for (int i = 0; i < n; i++) {
                	for (int j = 0; j < m; j++) {
                		if (a[i][j] != '#' && !Character.isDigit(a[i][j])) out.println(i + " " + j + ": " + a[i][j]);
                		if (a[i][j] != '#' && !ww[i][j]) {
                			int fuck = dfscheck(i, j);
                			if (fuck < 2 || fuck > 5) out.println(i + " " + j + ": count = " + fuck);
                		}
                	}
                }

                for (int i = 0; i < n; i++) {
                        for (int j = 0; j < m; j++) {
                                out.print(a[i][j]);
                        }
                        out.println();
                }
        }
        
        public void run() {
                Locale.setDefault(Locale.UK);
                try {
                        in = new BufferedReader(new InputStreamReader(System.in));
                        out = new PrintWriter(System.out);
//                      in = new BufferedReader(new FileReader("input.txt"));
//                      out = new PrintWriter("output.txt");
                        solve();
                } catch (Exception e) {
                        e.printStackTrace();
                        System.exit(1);
                } finally {
                        out.flush();
                }
        }

}