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.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Task2 {

    public static void main(String[] args) throws IOException {

        new Task2().solve();

    }

    int mod = 1000000007;

    PrintWriter out;

    int n;
    int m;

    ArrayList<Integer>[] g;

    void solve() throws IOException {

        //Reader in = new Reader("in.txt");
        //out = new PrintWriter( new BufferedWriter(new FileWriter("output.txt")) );
        Reader in = new Reader();
        PrintWriter out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );

        //BufferedReader br = new BufferedReader( new FileReader("in.txt") );
        //BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );

        int n = in.nextInt();
        int m = in.nextInt();

        int[][] a = new int[n][m];

        for (int i = 0; i < n; i++) {

            String s = in.nextLine();
            for (int j = 0; j < m; j++)
                if (s.charAt(j) == '#')
                    a[i][j] = -1;
        }

        int c = 1;

        for (int i = 0; i < n; i++) {

            for (int j = 1; j < m; j++) {

                if (a[i][j] == 0 && a[i][j-1] == 0) {

                    a[i][j-1] = a[i][j] = c++;
                }
            }
        }

        for (int i = 1; i < n; i++) {

            for (int j = 0; j < m; j++) {

                if (a[i][j] == 0 && a[i-1][j] == 0) {

                    a[i-1][j] = a[i][j] = c++;
                }
            }
        }

        int[] dx = {1, 0, -1, 0};
        int[] dy = {0, 1, 0, -1};

        boolean ok = true;

        for (int i = 0; i < n; i++)

            for (int j = 0; j < m; j++) {

                if (a[i][j] == 0) {

                    for (int k = 0; k < 4; k++) {

                        int nx = i+dx[k];
                        int ny = j+dy[k];

                        if (nx >= 0 && nx < n && ny >= 0 && ny < m && a[nx][ny] > 0) {

                            a[i][j] = a[nx][ny];
                            break;
                        }
                    }

                    if (a[i][j] == 0)
                        ok = false;
                }
            }


        int[][] ans = new int[n][m];

        if (!ok) {

            out.println(-1);
        }
        else {

            for (int i = 0; i < n; i++) {

                int add = 1;

                if (i%3 == 0)
                    add = 1;

                if (i%3 == 1)
                    add = 4;

                if (i%3 == 2)
                    add = 7;

                int s = 0;

                for (int j = 0; j < m; j++) {

                    if (ans[i][j] == 0 && a[i][j] != -1) {

                        ans[i][j] = s%3+add;
                        s++;

                        Queue<Pair> q = new LinkedList();

                        q.add(new Pair(i, j));

                        while (!q.isEmpty()) {

                            int x = q.peek().a;
                            int y = q.peek().b;
                            q.poll();

                            for (int k = 0; k < 4; k++) {

                                int nx = x+dx[k];
                                int ny = y+dy[k];

                                if (nx >= 0 && nx < n && ny >= 0 && ny < m && ans[nx][ny] == 0 && a[x][y] == a[nx][ny]) {

                                    ans[nx][ny] = ans[x][y];
                                    q.add(new Pair(nx, ny));
                                }
                            }
                        }

                    }


                }

            }


            for (int i = 0; i < n; i++) {

                for (int j = 0; j < m; j++)
                    if (ans[i][j] == 0)
                        out.print("#");
                    else
                        out.print(ans[i][j]);
                out.println();
            }


        }


        out.flush();
        out.close();
    }


    class Pair implements Comparable<Pair>{

        int a;
        int b;

        Pair(int a, int b) {

            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair p) {

            if (b < p.b)
                return 1;

            if (b > p.b)
                return -1;

            return 0;
        }

        //		@Override
        //		public boolean equals(Object o) {
        //			Pair p = (Pair) o;
        //			return a == p.a && b == p.b;
        //		}
        //
        //		@Override
        //		public int hashCode() {
        //			return Integer.valueOf(a).hashCode() + Integer.valueOf(b).hashCode();
        //		}

    }

    class Reader {

        BufferedReader  br;
        StringTokenizer tok;

        Reader(String file) throws IOException {
            br = new BufferedReader( new FileReader(file) );
        }

        Reader() throws IOException {
            br = new BufferedReader( new InputStreamReader(System.in) );
        }

        String next() throws IOException {

            while (tok == null || !tok.hasMoreElements())
                tok = new StringTokenizer(br.readLine());
            return tok.nextToken();
        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.valueOf(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.valueOf(next());
        }

        double nextDouble() throws NumberFormatException, IOException {
            return Double.valueOf(next());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

    }

}