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:

/**
 * 3 3
... ... ...


6 6
......
...... ...... ...... ...... ......
 */
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import java.math.*;
import java.util.*;
public class Main {
    private class Scanner {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        public boolean hasNext() {
            return sc.hasNext();
        }
        public String next() {
            return sc.next();
        }
        public BigDecimal nextBigDecimal() {
            return new BigDecimal(sc.next());
        }
        public BigInteger nextBigInteger() {
            return new BigInteger(sc.next());
        }
        public double nextDouble() {
            return Double.valueOf(sc.next());
        }
        public int nextInt() {
            return Integer.valueOf(sc.next());
        }
        public long nextLong() {
            return Long.valueOf(sc.next());
        }
    }
    public static void main(String[] args) {
        new Main().run();
    }
    static void debug(Object... os) {
//      System.err.println(deepToString(os));
    }
    Scanner sc = new Scanner();
    void run() {
        h=sc.nextInt();w=sc.nextInt();
        cs=new char[h][w];
        for(int i=0;i<h;i++)cs[i]=sc.next().toCharArray();
        if(!solve()){
            System.out.println(-1);return;
        }
        for(int i=0;i<h;i++)System.out.println(new String(cs[i]));
    }
    int[] dx={0,1,0,-1};
    int[] dy={1,0,-1,0};
    private boolean solve(){
        for(int i=0;i<h;i++)for(int j=0;j<w;j++)if(cs[i][j]=='.'){
            boolean ok=false;
            for(int d=0;d<4;d++){
                int nx=i+dx[d],ny=j+dy[d];
                if(0<=nx&&nx<h&&0<=ny&&ny<w && cs[nx][ny]!='#')ok=true;
            }
            if(!ok)return false;
        }
        Stack<Integer> stc = new Stack<Integer>();
        
        for(int i=0;i<h;i++)for(int j=0;j<w;j++)if(cs[i][j]=='.' && ikidomari(i,j)){
            stc.add(i);stc.add(j);
        }
        
        while(!stc.isEmpty()){
            int j=stc.pop(),i=stc.pop();
            if(cs[i][j]!='.')continue;
            assert ikidomari(i,j);
            debug("i,j",i,j);
            
            for(int d=0;d<4;d++){
                int nx=i+dx[d],ny=j+dy[d];
                if(0<=nx&&nx<h&&0<=ny&&ny<w && cs[nx][ny]=='.'){
                    debug("nx,ny",nx,ny);
                    int cant = cant(nx,ny);
                    
                    for(int e=0;e<4;e++){
                        int nnx=nx+dx[e],nny=ny+dy[e];
                        if(0<=nnx&&nnx<h&&0<=nny&&nny<w && cs[nnx][nny]=='.' && ikidomari(nnx,nny)){
                            cant |= cant(nnx,nny);
                        }
                    }
                    int p = Integer.numberOfTrailingZeros(~cant);
                    assert p<=9;
                    char c = (char)(p+'0');
                    
                    for(int e=0;e<4;e++){
                        int nnx=nx+dx[e],nny=ny+dy[e];
                        if(0<=nnx&&nnx<h&&0<=nny&&nny<w && cs[nnx][nny]=='.' && ikidomari(nnx,nny)){
                            debug("nnx,nny",nnx,nny);
                            cs[nnx][nny]=c;
                        }
                    }
                    cs[nx][ny] = c;
                    
                    for(int e=0;e<4;e++){
                        int nnx=nx+dx[e],nny=ny+dy[e];
                        if(0<=nnx&&nnx<h&&0<=nny&&nny<w && cs[nnx][nny]=='.' && ikidomari(nnx,nny)){
                            stc.push(nnx);stc.push(nny);
                        }
                    }
                    
                    break;
                }
            }
            debug(cs);
        }
        
        for(int s=0;s<h;s++)for(int t=0;t<w;t++)if(cs[s][t]=='.'){
            assert !ikidomari(s,t);
            stc.push(s);stc.push(t);

            debug(cs);
            while(!stc.isEmpty()){
                int j=stc.pop(),i=stc.pop();
                if(cs[i][j]!='.')continue;
//              assert ikidomari(i,j);
                debug("i,j",i,j);
                
                for(int d=0;d<4;d++){
                    int nx=i+dx[d],ny=j+dy[d];
                    if(0<=nx&&nx<h&&0<=ny&&ny<w && cs[nx][ny]=='.'){
                        debug("nx,ny",nx,ny);
                        int cant = cant(nx,ny) | cant(i,j);
                        
                        for(int e=0;e<4;e++){
                            int nnx=nx+dx[e],nny=ny+dy[e];
                            if(0<=nnx&&nnx<h&&0<=nny&&nny<w && cs[nnx][nny]=='.' && ikidomari(nnx,nny)){
                                cant |= cant(nnx,nny);
                            }
                        }
                        int p = Integer.numberOfTrailingZeros(~cant);
                        assert p<=9;
                        char c = (char)(p+'0');
                        
                        for(int e=0;e<4;e++){
                            int nnx=nx+dx[e],nny=ny+dy[e];
                            if(0<=nnx&&nnx<h&&0<=nny&&nny<w && cs[nnx][nny]=='.' && ikidomari(nnx,nny)){
                                debug("nnx,nny",nnx,nny);
                                cs[nnx][nny]=c;
                            }
                        }
                        cs[i][j] = c;
                        cs[nx][ny] = c;
                        
                        for(int e=0;e<4;e++){
                            int nnx=nx+dx[e],nny=ny+dy[e];
                            if(0<=nnx&&nnx<h&&0<=nny&&nny<w && cs[nnx][nny]=='.' && ikidomari(nnx,nny)){
                                stc.push(nnx);stc.push(nny);
                            }
                        }
                        
                        break;
                    }
                }
            }
        }
        
        
        return true;
    }
    private int cant(int i,int j){
        int res=0;
        for(int d=0;d<4;d++){
            int nx=i+dx[d],ny=j+dy[d];
            if(0<=nx&&nx<h&&0<=ny&&ny<w && Character.isDigit(cs[nx][ny])){
                res |= 1<<cs[nx][ny]-'0';
            }
        }
        return res;
    }
    boolean ikidomari(int i,int j){
        int cnt=0;
        for(int d=0;d<4;d++){
            int nx=i+dx[d],ny=j+dy[d];
            if(0<=nx&&nx<h&&0<=ny&&ny<w && cs[nx][ny]=='.')cnt++;
        }
        assert cnt>=1;
        if(cnt==1)return true;
        return false;
    }
    
    int h,w;
    char[][] cs;
    
}