Drazil created a following problem about putting 1 × 2 tiles into an n × m grid:

"There is a grid with some cells that are empty and some cells that are occupied. You should use 1 × 2 tiles to cover all empty cells and no two tiles should cover each other. And you should print a solution about how to do it."

But Drazil doesn't like to write special checking program for this task. His friend, Varda advised him: "how about asking contestant only to print the solution when it exists and it is unique? Otherwise contestant may print 'Not unique' ".

Drazil found that the constraints for this task may be much larger than for the original task!

Can you solve this new problem?

Note that you should print 'Not unique' either when there exists no solution or when there exists several different solutions for the original task.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 2000).

The following n lines describe the grid rows. Character '.' denotes an empty cell, and the character '*' denotes a cell that is occupied.

Output

If there is no solution or the solution is not unique, you should print the string "Not unique".

Otherwise you should print how to cover all empty cells with 1 × 2 tiles. Use characters "<>" to denote horizontal tiles and characters "^v" to denote vertical tiles. Refer to the sample test for the output format example.

Examples

Input

3 3
...
.*.
...


Output

Not unique


Input

4 4
..**
*...
*.**
....


Output

&lt;&gt;**
*^&lt;&gt;
*v**
&lt;&gt;&lt;&gt;


Input

2 4
*..*
....


Output

*&lt;&gt;*
&lt;&gt;&lt;&gt;


Input

1 1
.


Output

Not unique


Input

1 1
*


Output

*

Note

In the first case, there are indeed two solutions:
    
    
      
    <>^  
    ^*v  
    v<>  
    

and
    
    
      
    ^<>  
    v*^  
    <>v  
    

so the answer is "Not unique".
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class Main {

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

		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;

		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);

		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}

}

class TaskA {

	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int a = in.nextInt();
		int b = in.nextInt();
		int s = in.nextInt();

		int ss = Math.abs(a) + Math.abs(b);
		if (s < ss) {
			out.println("No");
			return;
		}
		if (s == ss) {
			out.println("Yes");
			return;
		} else {
			if (s - ss == 1) {
				out.println("No");
			} else {
				out.println("Yes");
			}
		}

	}

}

class TaskB {

	public void solve(int testNumber, InputReader in, PrintWriter out)
			throws IOException {
		int n = in.nextInt();
		boolean[] unhappyBoys = new boolean[n];

		for (int i = 0; i < n; ++i) {
			unhappyBoys[i] = true;
		}

		int m = in.nextInt();
		boolean[] unhappyGirls = new boolean[m];
		for (int i = 0; i < m; ++i) {
			unhappyGirls[i] = true;
		}

		int b = in.nextInt();
		int hb[] = new int[b];

		for (int i = 0; i < b; ++i) {
			hb[i] = in.nextInt();
			unhappyBoys[hb[i]] = false;
		}

		int g = in.nextInt();
		int[] hg = new int[g];
		for (int i = 0; i < g; ++i) {
			hg[i] = in.nextInt();
			unhappyGirls[hg[i]] = false;
			;
		}

		int limit = n * n * m * m;
		for (int i = 0; i <= limit + 1; ++i) {

			int boy = i % n;
			int girl = i % m;

			boolean happyBoy = !unhappyBoys[boy];
			boolean happyG = !unhappyGirls[girl];

			if (happyBoy && !happyG) {
				unhappyGirls[girl] = false;
			} else if (happyG && !happyBoy) {
				unhappyBoys[boy] = false;
			}

		}

		for (int i = 0; i < unhappyGirls.length; ++i) {
			if (unhappyGirls[i]) {
				out.println("No");
				return;
			}
		}

		for (int i = 0; i < unhappyBoys.length; ++i) {
			if (unhappyBoys[i]) {
				out.println("No");
				return;
			}
		}

		out.println("Yes");
	}

}

class TaskC {

	public void solve(int testNumber, InputReader in, PrintWriter out) {

	}

}

class TaskD {

	public void solve(int testNumber, InputReader in, PrintWriter out) {

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

		byte[][] output = new byte[n][m];

		String[] s = new String[n];
		for (int i = 0; i < n; ++i) {
			s[i] = in.next();
		}

		Node[][] nodes = new Node[n][m];

		for (short i = 0; i < n; ++i) {
			for (short j = 0; j < m; ++j) {
				if (s[i].charAt(j) == '.') {
					nodes[i][j] = new Node(i, j);
				}
			}
		}

		int[][] delta = { { 0, 1 }, { 0, -1 }, { 1, 0 }, { -1, 0 } };

		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				if (s[i].charAt(j) == '.') {
					Node node = nodes[i][j];
					for (int[] d : delta) {
						int ni = i + d[0];
						int nj = j + d[1];
						if (ni >= 0 && nj >= 0 && ni < n && nj < m
								&& s[ni].charAt(nj) == '.') {
							node.rank++;
							// nodes[ni][nj].rank++;
						}
					}
				}
			}
		}

		Queue<Node> pq = new LinkedList<Node>();
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				if (s[i].charAt(j) == '.') {
					if (nodes[i][j].rank == 1) {
						pq.add(nodes[i][j]);
					}
				}
			}
		}

		while (!pq.isEmpty()) {
			Node node = pq.poll();
			if(output[node.i][node.j]!=0){
				continue;
			}
			
			Node next = null;

			for (int[] d : delta) {
				int ni = node.i + d[0];
				int nj = node.j + d[1];
				if (ni >= 0 && nj >= 0 && ni < n && nj < m
						&& s[ni].charAt(nj) == '.' && output[ni][nj] == 0) {
					next = nodes[ni][nj];
				}
			}
			if(next==null){
				out.println("Not unique");
				return;
			}
			print(output, node, next);

			for (int[] d : delta) {
				int ni = next.i + d[0];
				int nj = next.j + d[1];
				if (ni >= 0 && nj >= 0 && ni < n && nj < m
						&& s[ni].charAt(nj) == '.' && output[ni][nj] == 0) {
					nodes[ni][nj].rank--;
					if (nodes[ni][nj].rank == 1) {
						pq.add(nodes[ni][nj]);
					}
				}
			}
		}

		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				if (nodes[i][j] != null && output[i][j] == 0) {
					out.println("Not unique");
					return;
				}
			}
		}

		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				if (output[i][j] == 0) {
					out.print('*');
				} else if (output[i][j] == 1) {
					out.print('<');
				} else if (output[i][j] == 2) {
					out.print('>');
				} else if (output[i][j] == 3) {
					out.print('^');
				} else if (output[i][j] == 4) {
					out.print('v');
				}
			}
			out.println();
		}

	}

	private void print(byte[][] output, Node n1, Node n2) {
		int i1 = Math.min(n1.i, n2.i);
		int j1 = Math.min(n1.j, n2.j);
		int i2 = Math.max(n1.i, n2.i);
		int j2 = Math.max(n1.j, n2.j);

		if (i1 == i2) {
			// output[i1][j1]='<';
			// output[i1][j2]='>';
			output[i1][j1] = 1;
			output[i1][j2] = 2;
		} else {
			// output[i1][j1]='^';
			// output[i2][j1]='v';
			output[i1][j1] = 3;
			output[i2][j1] = 4;
		}
	}

}

class Node implements Comparable<Node> {

	public Node(short i, short j) {
		this.i = i;
		this.j = j;
	}

	short i;
	short j;
	short rank = 0;

	@Override
	public String toString() {
		return "Node [i=" + i + ", j=" + j + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + i;
		result = prime * result + j;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Node other = (Node) obj;
		if (i != other.i)
			return false;
		if (j != other.j)
			return false;
		return true;
	}

	@Override
	public int compareTo(Node o) {
		return rank - o.rank;
	}

}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

}
