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.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Locale;
import java.util.StringTokenizer;

public class Main {
	private static final String TASKNAME = "b";

	private void solve() throws Exception {
		int n = nextInt();
		int m = nextInt();
		char[][] grid = new char[n][];
		for (int i = 0; i < n; ++i) {
			grid[i] = nextToken().toCharArray();
		}
		int[][] ans = new int[n][m];
		int[] dx = { 1, 0, -1, 0 };
		int[] dy = { 0, 1, 0, -1 };
		int[] masks = new int[(int) 2e6];

		int count = 1;

		final int m2 = masks.length - 1;
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				if (grid[i][j] == '#') {
					ans[i][j] = m2;
					continue;
				}
				if (ans[i][j] != 0) {
					continue;
				}
				boolean ok = false;
				for (int dir = 0; dir < 4; ++dir) {
					int ni = i + dy[dir];
					int nj = j + dx[dir];
					if (ni < 0 || ni >= n || nj < 0 || nj >= m || grid[ni][nj] == '#' || ans[ni][nj] != 0) {
						continue;
					}
//					System.err.println("" + i + " " + j + " " + ni + " " + nj + " " + count);
					ans[ni][nj] = ans[i][j] = count++;
					ok = true;
					break;
				}
				for (int dir = 0; !ok && dir < 4; ++dir) {
					int ni = i + dy[dir];
					int nj = j + dx[dir];
					if (ni < 0 || ni >= n || nj < 0 || nj >= m || grid[ni][nj] == '#') {
						continue;
					}
					ok = true;
					ans[i][j] = ans[ni][nj];
					break;
				}
//				System.err.println("" + i + " " + j);
				if (!ok) {
//					System.err.println("" + i + " " + j);
					println("-1");
					return;
				}
			}
//			System.err.println();
		}
//		for (int i = 0; i < n; ++i) {
//			System.err.println(Arrays.toString(ans[i]));
//		}

//		System.err.println("count = " + count);
		int[] cnt = new int[(int)2e6];
		int[] color = new int[(int)2e6];
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				if (ans[i][j] == m2) {
					continue;
				}
				if (color[ans[i][j]] > 0) {
					continue;
				}
				int mask = 0;
				for (int r = Math.max(i - 2, 0); r <= Math.min(n - 1, i + 2); ++r) {
					for (int c = Math.max(j - 2, 0); c <= Math.min(m - 1, j + 2); ++c) {
						if (ans[r][c] == ans[i][j]) {
//							System.err.println("" + r + " " + c + " = " + i + " " + j);
							for (int dir = 0; dir < 4; ++dir) {
								int nr = r + dx[dir];
								int nc = c + dy[dir];
								if (nr >= 0 && nr < n && nc >= 0 && nc < m) {
//									System.err.println("ans = " + ans[i][j] + " fc " + color[ans[nr][nc]]);
									mask |= 1 << color[ans[nr][nc]];
								}
							}
						}
					}
				}
//				System.err.println(mask);
				boolean found = false;
				for (int c = 1; c <= 10; ++c) {
					if ((mask & (1 << c)) == 0) {
						color[ans[i][j]] = c;
//						System.err.println(c);
						found = true;
						break;
					}
				}
				++cnt[ans[i][j]];
				if (cnt[ans[i][j]] > 5) {
					throw new AssertionError();
				}
				if (!found) {
					throw new AssertionError();
				}
			}
		}
		

		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				if (ans[i][j] == m2) {
					print('#');
				} else {
					print((char) ('0' -1 + color[ans[i][j]]));
				}
			}
			println("");
		}
	}

	private void run() {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			writer = new PrintWriter(new OutputStreamWriter(System.out));
//			reader = new BufferedReader(new FileReader(TASKNAME + ".in"));
//			writer = new PrintWriter(new File(TASKNAME + ".out"));

			solve();

			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(13);
		}
	}

	public static void main(String[] args) {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		new Main().run();
		System.err.printf("%.3f\n", (System.currentTimeMillis() - time) * 1e-3);
	}

	private StringTokenizer tokenizer;
	private PrintWriter writer;
	private BufferedReader reader;

	private String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

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

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

	private double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	private void print(Object o) {
		writer.print(o);
	}

	private void println(Object o) {
		writer.println(o);
	}

	private void printf(String format, Object... args) {
		writer.printf(format, args);
	}
}