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.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;


import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.StringTokenizer;



public final class CF_DazilTiles {

	void log(int[] X){
		int L=X.length;
		for (int i=0;i<L;i++){
			logWln(X[i]+" ");
		}
		log("");
	}


	void log(long[] X){
		int L=X.length;
		for (int i=0;i<L;i++){
			logWln(X[i]+" ");
		}
		log("");
	}
	void log(Object[] X){
		int L=X.length;
		for (int i=0;i<L;i++){
			logWln(X[i]+" ");
		}
		log("");
	}


	void log(Object o){
		logWln(o+"\n");
	}

	void logWln(Object o){
		//System.out.print(o);
		outputWln(o);

	}
	void info(Object o){
		System.out.println(o);
		//output(o);
	}

	void output(Object o){

		outputWln(""+o+"\n");

	}

	void outputWln(Object o){
		// System.out.print(o);

		try {
			out.write(""+ o);
		} catch (Exception e) {

		}
	}


	String next(){
		while (st== null|| !st.hasMoreTokens()) {
			try {
				st=new StringTokenizer(in.readLine());
			} catch (Exception e) {
			}
		}
		return st.nextToken();
	}

	String nextLine(){
		try {
			return in.readLine();
		} catch (Exception e) {
		}
		return null;
	}

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


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


	}



	// Global vars
	StringTokenizer st;
	BufferedReader in;
	BufferedWriter out;
	String[] s;
	int N,M;
	int[][] mem;
	static String NO="Not unique";
	int cnt;

	boolean isEmpty(int x,int y){
		if (x<0 || x>N || y<0 || y>M)
			return false;
		return (mem[x][y]==0);
	}

	int mem(int x,int y){
		if (x<0 || x>=N || y<0 || y>=M)
			return '*';
		return mem[x][y];
	}

	int sum(int i,int j){
		int res=0;
		if (mem(i-1,j)!='.')
			res++;
		if (mem(i+1,j)!='.')
			res++;
		if (mem(i,j-1)!='.')
			res++;
		if (mem(i,j+1)!='.')
			res++;
		return res;
	}

	class Composite {
		int x;
		int y;
		
		public Composite(int x,int y){
			super();
			this.x=x;
			this.y=y;
		}
		
		
	}
	
	
	void tryFill(int a,int b){
		
		ArrayDeque<Composite> pq=new ArrayDeque<Composite>();
		
		Composite X=new Composite(a,b);
		
		pq.add(X);
		while (pq.size()>0){
		X=pq.poll();
		int x=X.x;
		int y=X.y;
		if ((mem[x][y]=='.') && sum(x,y)==3) {
		int u=x;
		int v=y;
		cnt+=2;
		if (mem(x-1,y)=='.'){
			u=x-1;
			mem[x][y]='v';
			mem[x-1][y]='^';
		} else 
			if (mem(x+1,y)=='.') {
				u=x+1;
				mem[x][y]='^';
				mem[x+1][y]='v';
			}
			else if (mem(x,y-1)=='.'){
				v=y-1;
				mem[x][y-1]='<';
				mem[x][y]='>';
			}
			else
				if (mem(x,y+1)=='.') {
					v=y+1;
					mem[x][y]='<';
					mem[x][y+1]='>';
				}	
		//	show();
		//log("---------------");
		if (mem(u-1,v)=='.' && (sum(u-1,v)==3))
			pq.add(new Composite(u-1,v)); //tryFill(u-1,v);
		if (mem(u+1,v)=='.' && (sum(u+1,v)==3))
			pq.add(new Composite(u+1,v)); // tryFill(u+1,v);
		if (mem(u,v-1)=='.' && (sum(u,v-1)==3))
			pq.add(new Composite(u,v-1)); // tryFill(u,v-1);
		if (mem(u,v+1)=='.' && (sum(u,v+1)==3))
			pq.add(new Composite(u,v+1)); // tryFill(u,v+1);
			}
		}
	}

	
	void solve(){
		mem=new int[N][M];
		cnt=0;
		for (int i=0;i<N;i++){
			for (int j=0;j<M;j++){
					mem[i][j]=s[i].charAt(j);
					if (mem[i][j]!='.')
						cnt++;
			}
		}

		for (int i=0;i<N;i++)
			for (int j=0;j<M;j++){
				if (mem[i][j]=='.'){
				int sum=sum(i,j);
				if (sum==4){
				//	output("BUG "+i+" "+j);
				//	show();
					output(NO);
					return;
				}
				if (sum==3){
					tryFill(i,j);
				}
			}
			}
		if (cnt<M*N) {
			output(NO);
		}
		else {
			//output("YES");
			show();
		}
	}
	
	void show(){
		for (int i=0;i<N;i++){
			for (int j=0;j<M;j++)
				logWln((char)mem[i][j]);
			log("");
		}
	}
	

	int MAX=2001;
	
	/*
	
	class CompositeOld {
		int x;
		int y;

		int prevx;
		int prevy;


		public CompositeOld(int x,int y,int prevx,int prevy){
			super();
			this.x=x;
			this.y=y;
			this.prevx=prevx;
			this.prevy=prevy;
		}

		public boolean equals(Object O){
			CompositeOld X=(CompositeOld)O;
			return ((x==X.x) && (y==X.y));
		}

		public String toString(){
			return ("<<x:"+x+" y:"+y+">>");
		}
		
	}

	boolean floodFill(int a,int b,int color){
		log("Flood fill");
		ArrayDeque<CompositeOld> pq=new ArrayDeque<CompositeOld>();
		CompositeOld X=new CompositeOld(a,b,a,b);
		pq.add(X);
		while (pq.size()>0){
			
			X=pq.poll();
			log(X);
			int x=X.x;
			int y=X.y;
			mem[x][y]=color;
			if (mem(x-1,y)==0){
				pq.add(new Composite(x-1,y,x,y));
			} else {
				if (mem(x-1,y)==color && ! (x-1==X.prevx && y==X.prevy)){
					log("Loop");
					return true;
				}
			}
			if (mem(x+1,y)==0) {
				pq.add(new Composite(x+1,y,x,y));
			} else {
				if (mem(x+1,y)==color && ! (x+1==X.prevx && y==X.prevy)){
					log("Loop");
					
					return true;
				}
			}
			if (mem(x,y-1)==0){
				pq.add(new Composite(x,y-1,x,y));
			} else {
				if (mem(x,y-1)==color && ! (x==X.prevx && y-1==X.prevy)){
					log("Loop");
					
					return true;
				}
			}

			if (mem(x,y+1)==0){
				pq.add(new Composite(x,y+1,x,y));
			} else {
				if (mem(x,y+1)==color && ! (x==X.prevx && y+1==X.prevy)){
					log("Loop");
					
					return true;
				}
			}
		}
		return false;
	}

	void solveFloodKO(){
		mem=new int[N][M];
		for (int i=0;i<N;i++){
			for (int j=0;j<M;j++){
				if (s[i].charAt(j)=='*')
					mem[i][j]=1;
			}
		}
		for (int i=0;i<N;i++){
			for (int j=0;j<M;j++)
				logWln(mem[i][j]+" ");
			log("");	
		}
		int color=2;
		for (int i=0;i<N;i++)
			for (int j=0;j<M;j++){
				if (mem[i][j]==0){
					int sum=sum(i,j);
					if (sum==4){
						output(NO);
						return;
					}
					if (floodFill(i,j,color)){
						output(NO);
						return;
					}
				}
			}
	}
*/

				void process() throws Exception {



					out = new BufferedWriter(new OutputStreamWriter(System.out));
					in=new BufferedReader(new InputStreamReader(System.in));

					N=nextInt();
					M=nextInt();
					s=new String[N];

					for (int i=0;i<N;i++){
						s[i]=next();
					}

					solve();
					try {
						out.close();
					}
					catch (Exception e){}
				}



				public static void main(String[] args) throws Exception {
					CF_DazilTiles J=new CF_DazilTiles();


					J.process();


				}


			}