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.*;

public class Solution implements Runnable {

	BufferedReader input;
	StringTokenizer tokenizer;
	PrintWriter output;
	
	int n, m;
	boolean[][] a;
	int[][] map;
	int colors;
	int[] dr = new int[]{0, 0, -1, 1};
	int[] dc = new int[]{-1, 1, 0, 0};
	
	int[][] conflicts;
	int[] ccount;
	
	void addConflict(int i, int j)
	{
		if (i < j)
		{
			int t = i; i = j; j = t;
		}
		if (ccount[i] == 0 || conflicts[ccount[i] - 1][i] != j)
		{
			conflicts[ccount[i]++][i] = j;
		}
	}
	
	boolean free(int r, int c)
	{
		if (r < 0 || r >= n || c < 0 || c >= m) return false;
		return a[r][c] && map[r][c] == -1;
	}
	
	boolean isolated(int r, int c)
	{
		if (!free(r, c)) return false;
		for (int i = 0; i < 4; i++)
		{
			if (free(r + dr[i], c + dc[i])) return false;
		}
		return true;
	}
	
	private void solve() throws Exception
	{
		n = nextInt();
		m = nextInt();
		a = new boolean[n][m];
		for (int i = 0; i < n; i++)
		{
			char[] c = next().toCharArray();
			for (int j = 0; j < m; j++)
			{
				a[i][j] = c[j] == '.';
			}
		}
		map = new int[n][m];
		for (int i = 0; i < n; i++)
		{
			Arrays.fill(map[i], -1);
		}
		
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < m; j++)
			{
				if (!free(i, j)) continue;
				if (isolated(i, j))
				{
					output.println(-1);
					return;
				}
				map[i][j] = colors;
				int[] nr;
				int[] nc;
				if (free(i, j + 1))
				{
					map[i][j + 1] = colors;
					nr = new int[]{1, 1, 0};
					nc = new int[]{0, 1, 2};
				}
				else
				{
					map[i + 1][j] = colors;
					nr = new int[]{0, 1, 1, 2};
					nc = new int[]{1, 1, -1, 0};
				}
				for (int k = 0; k < nr.length; k++)
				{
					if (isolated(i + nr[k], j + nc[k]))
					{
						map[i + nr[k]][j + nc[k]] = colors;
					}
				}
				colors++;
			}
		}

		conflicts = new int[10][colors];
		ccount = new int[colors];
//		HashSet<Integer>[] conflicts = new HashSet[colors];
//		for (int i = 0; i < colors; i++)
//		{
//			conflicts[i] = new HashSet<Integer>();
//		}

		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < m; j++)
			{
				int c = map[i][j];
				if (c == -1) continue;
				if (i + 1 < n)
				{
					int c2 = map[i + 1][j];
					if (c2 != -1 && c2 != c)
					{
						addConflict(c, c2);
					}
				}
				if (j + 1 < m)
				{
					int c2 = map[i][j + 1];
					if (c2 != -1 && c2 != c)
					{
						addConflict(c, c2);
					}
				}
			}
		}
		
		int[] digit = new int[colors];
		Arrays.fill(digit, -1);
		boolean[] used = new boolean[10];
		for (int i = 0; i < colors; i++)
		{
			Arrays.fill(used, false);
			for (int j = 0; j < ccount[i]; j++)
			{
				int c = conflicts[j][i];
				int d = digit[c];
				if (d != -1)
				{
					used[d] = true;
				}
			}
			for (int j = 0; j < 10; j++)
			{
				if (used[j]) continue;
				digit[i] = j;
				break;
			}
		}
		for (int i = 0; i < n; i++)
		{
			char[] s = new char[m];
			for (int j = 0; j < m; j++)
			{
				s[j] = a[i][j] ? (char)(digit[map[i][j]] + '0') : '#';
			}
			output.println(new String(s));
		}
	}

	private int nextInt() throws Exception
	{
		return Integer.parseInt(next());
	}

	private String next() throws Exception
	{
		if (tokenizer == null || !tokenizer.hasMoreTokens())
		{
			String s = "";
			while (s.equals(""))
			{
				s = input.readLine();
			}
			tokenizer = new StringTokenizer(s);
		}
		return tokenizer.nextToken();
	}

	private void out(String s)
	{
		output.println(s);
	}

	public void run() {
		try {
			solve();
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		} finally {
			output.close();
		}
	}
	
	public Solution() throws IOException {
		input = new BufferedReader(new InputStreamReader(System.in));
		output = new PrintWriter(System.out);
	}

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		new Thread(new Solution()).start();
	}
}