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.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(in, out);
        out.close();
    }
}

class Graph {
    private Set<Integer> neighbours[];

    @SuppressWarnings("unchecked")
    public Graph(int n) {
        neighbours = new Set[n];
        for(int i=0;i<n;i++){
            neighbours[i] = new HashSet<>();
        }
    }

    public void addEdge(int from, int to) {
        neighbours[from].add(to);
        neighbours[to].add(from);
    }

    public Set<Integer> getNeighbours(int v) {
        return neighbours[v];
    }
}

class TaskD {



    public void solve(InputReader in, OutputWriter out) {
        int n = in.nextInt();
        int m = in.nextInt();

        char tab[][] = new char[n][m];
        for(int i=0;i<n;i++) {
            tab[i] = in.next().toCharArray();
        }

        Queue<Pair> queue = new ArrayDeque<>();
        for(int i=0;i<n;i++) {
            for(int j=0;j<m;j++) {
                if(tab[i][j] != '*' && hasOnlyOneFreeNeighbour(tab,n,m,i,j) ) {
                    queue.add(new Pair(i,j));
                }
            }
        }

        while(!queue.isEmpty()) {
            Pair cell = queue.remove();
            if(tab[cell.x][cell.y] != '.') continue;
            Pair neighbourCell = findFreeNeighbourCell(tab,n,m,cell);
            if(neighbourCell == null) break;
            assignValues(tab, cell.x, cell.y, neighbourCell.x, neighbourCell.y);
            List<Pair> list = findNext(tab, n,m, neighbourCell.x, neighbourCell.y);
            for(Pair pair : list) queue.add(pair);

        }
        if(valid(tab,n,m)) {
            for(int i=0;i<n;i++) {
                for(int j=0;j<m;j++) {
                    out.print(tab[i][j]);
                }
                out.printLine();
            }
        } else {
            out.printLine("Not unique");
        }


    }

    private List<Pair> findNext(char[][] tab, int n, int m, int i, int j) {
        List<Pair> list = new ArrayList<>();
        if(hasOnlyOneFreeNeighbour(tab,n,m,i-1,j)) list.add(new Pair(i-1,j));
        if(hasOnlyOneFreeNeighbour(tab,n,m,i+1,j)) list.add(new Pair(i+1,j));
        if(hasOnlyOneFreeNeighbour(tab,n,m,i,j-1)) list.add(new Pair(i,j-1));
        if(hasOnlyOneFreeNeighbour(tab,n,m,i,j+1)) list.add(new Pair(i,j+1));
        return list;
    }

    private boolean valid(char[][] tab, int n, int m) {
        boolean valid = true;
        for(int i=0;i<n;i++) {
            for (int j = 0; j < m; j++) {
                if(tab[i][j] == '.') {
                    valid = false;
                    break;
                }
            }
        }
        return valid;
    }

    private void assignValues(char[][] tab, int i, int j, int k, int l) {
        if(i == k) {
            if(j < l) {
                tab[i][j] = '<';
                tab[k][l] = '>';
            } else {
                tab[i][j] = '>';
                tab[k][l] = '<';
            }
        } else {
            if(i < k) {
                tab[i][j] = '^';
                tab[k][l] = 'v';
            } else {
                tab[i][j] = 'v';
                tab[k][l] = '^';
            }
        }
    }

    private Pair findFreeNeighbourCell(char tab[][], int n, int m, Pair cell) {
        int i = cell.x;
        int j = cell.y;
        if(i-1 >= 0 && tab[i-1][j] == '.') return new Pair(i-1,j);
        if(i+1 < n && tab[i+1][j] == '.') return new Pair(i+1,j);
        if(j-1 >= 0 && tab[i][j-1] == '.') return new Pair(i,j-1);
        if(j+1 < m && tab[i][j+1] == '.') return new Pair(i,j+1);

        return null;
    }

    private boolean hasOnlyOneFreeNeighbour(char[][] tab,int n, int m, int i, int j) {
        if(i < 0 || i >= n || j < 0 || j >= m) return false;
        int count = 0;
        if(i-1 >= 0 && tab[i-1][j] == '.') count++;
        if(i+1 < n && tab[i+1][j] == '.') count++;
        if(j-1 >= 0 && tab[i][j-1] == '.') count++;
        if(j+1 < m && tab[i][j+1] == '.') count++;
        return count == 1;
    }


    class Pair {
        int x,y;

        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }


}
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 boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                String line = reader.readLine();
                if ( line == null ) {
                    return false;
                }
                tokenizer = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
}
class OutputWriter {
    private final PrintWriter writer;
    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }
    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }
    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if ( i != 0 ) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }
    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }
    public void close() {
        writer.close();
    }
}
