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.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) throws IOException {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					try {
						if (new File("input.txt").exists())
							System.setIn(new FileInputStream("input.txt"));
					} catch (SecurityException e) {}
					new Main().run();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "1", 1L << 24).start(); 
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	int N;
	int M;
	char[][] map;
	int[][] ans;
	
	int[] dr = { -1, 0, 1, 0 };
	int[] dc = { 0, -1, 0, 1 };
	
	int colNum = 0;
	
	int[] color;
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		N = nextInt();
		M = nextInt();
		map = new char [N][];
		for (int i = 0; i < N; i++)
			map[i] = nextToken().toCharArray();
		
		if (!check()) {
			out.println(-1);
			out.close();
			return;
		}
		
		ans = new int [N][M];
		for (int[] a : ans)
			fill(a, -1);
		for (int i = 0; i < N; i++)
			for (int j = 0; j < M; j++)
				if (map[i][j] == '.' && ans[i][j] == -1)
					put(i, j);
		
//		out.println();
//		for (int i = 0; i < N; i++) {
//			for (int j = 0; j < M; j++) {
//				if (ans[i][j] == -1)
//					out.print(".");
//				else
//					out.printf("%d", ans[i][j]);
//			}
//			out.println();
//		}
		
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < M; j++) {
				if (map[i][j] == '.' && ans[i][j] == -1) {
					append(i, j);
				}
			}
		}
		
//		out.println();
//		for (int i = 0; i < N; i++) {
//			for (int j = 0; j < M; j++) {
//				if (ans[i][j] == -1)
//					out.print(".");
//				else
//					out.printf("%d", ans[i][j]);
//			}
//			out.println();
//		}
//		out.println();
		
		if (!check()) {
			System.err.println("Something wrong!!!");
			out.println(-1);
			out.close();
			return;
		}
		
		color = new int [colNum];
		fill(color, -1);
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < M; j++) {
				if (map[i][j] == '.') {
					if (color[ans[i][j]] == -1)
						assignColor(i, j);
					map[i][j] = (char) ('0' + color[ans[i][j]]);
				}
			}
		}
		
		for (char[] row : map)
			out.println(row);
		
		out.close();
	}

	void put(int r, int c) {
		if (c + 1 < M && map[r][c + 1] == '.' && ans[r][c + 1] == -1) {
			ans[r][c] = ans[r][c + 1] = colNum++;
			return;
		}
		if (r + 1 < N && map[r + 1][c] == '.' && ans[r + 1][c] == -1) {
			ans[r][c] = ans[r + 1][c] = colNum++;
			return;
		}
	}
	
	void append(int r, int c) {
		for (int d = 0; d < dr.length; d++) {
			int nr = r + dr[d];
			int nc = c + dc[d];
			if (good(nr, nc) && ans[nr][nc] != -1) {
				ans[r][c] = ans[nr][nc];
				return;
			}
		}
	}
	
	boolean[] used = new boolean [10];
	int[][] was = new int [1000][10000];
	int wt = 0;
	
	void assignColor(int r, int c) {
		int v = ans[r][c];
		fill(used, false);
		wt++;
		dfs(r, c, v);
		for (int col = 0; col < 10; col++) {
			if (!used[col]) {
				color[v] = col;
				return;
			}
		}
		System.err.println("Can't assign color!!!");
	}

	void dfs(int r, int c, int v) {
		was[r][c] = wt;
		for (int d = 0; d < dr.length; d++) {
			int nr = r + dr[d];
			int nc = c + dc[d];
			if (good(nr, nc)) {
				if (ans[nr][nc] != -1) {
					int av = ans[nr][nc];
					if (color[av] != -1) {
						used[color[av]] = true;
					}
					if (ans[nr][nc] == v)
						if (was[nr][nc] != wt)
							dfs(nr, nc, v);
				}
			}
		}
	}

	boolean check() {
		for (int i = 0; i < N; i++)
			for (int j = 0; j < M; j++)
				if (map[i][j] == '.' && bad(i, j))
					return false;
		return true;
	}

	boolean bad(int r, int c) {
		for (int i = 0; i < dr.length; i++) {
			int nr = r + dr[i];
			int nc = c + dc[i];
			if (good(nr, nc) && map[nr][nc] == '.') {
				return false;
			}
		}
		return true;
	}

	boolean good(int r, int c) {
		return 0 <= r && r < N && 0 <= c && c < M;
	}


	/*************************************************************** 
	 * Input 
	 **************************************************************/
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		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());
	}
	
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}