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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.StringTokenizer;

public class _515D {

    static int n, m;
    static char[][] a;
    static int[] dx = { 0, 0, 1, -1 };
    static int[] dy = { 1, -1, 0, 0 };

    static void fill(int i, int j, int ii, int jj) {
        if (i == ii) {
            a[i][Math.min(j, jj)] = '<';
            a[i][Math.max(j, jj)] = '>';
        } else {
            a[Math.min(i, ii)][j] = '^';
            a[Math.max(i, ii)][j] = 'v';
        }

        //        for (int kk = 0; kk < n; kk++)
        //            System.out.println(String.valueOf(a[kk]));
        //        System.out.println();
    }

    static boolean isDot(int i, int j) {
        return i >= 0 && i < n && j >= 0 && j < m && a[i][j] == '.';
    }

    public static void main(String[] args) throws Exception {
        Reader.init(System.in);
        BufferedWriter cout = new BufferedWriter(new OutputStreamWriter(System.out));

        n = Reader.nextInt();
        m = Reader.nextInt();
        a = new char[n][];
        for (int i = 0; i < n; i++)
            a[i] = Reader.next().toCharArray();
        int[] degree = new int[n * m];
        Queue<Integer> queue = new ArrayDeque<Integer>(n * m);
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++) {
                if (a[i][j] != '.')
                    continue;
                int vertex = i * m + j;
                for (int k = 0; k < 4; k++) {
                    int x = i + dx[k];
                    int y = j + dy[k];
                    if (isDot(x, y))
                        degree[vertex]++;
                }
                if (degree[vertex] == 1)
                    queue.add(vertex);
            }

        while (!queue.isEmpty()) {
            int u = queue.poll();
            if (degree[u] == 0)
                continue; // very important
            int x = u / m, y = u % m;
            int xx = -1, yy = -1;
            int v = -1;
            for (int k = 0; k < 4; k++) {
                xx = x + dx[k];
                yy = y + dy[k];
                if (isDot(xx, yy)) {
                    v = xx * m + yy;
                    break;
                }
            }

            // remove vertex u and v
            fill(x, y, xx, yy);
            degree[u] = degree[v] = 0;
            for (int k = 0; k < 4; k++) {
                int xxx = xx + dx[k];
                int yyy = yy + dy[k];
                if (isDot(xxx, yyy)) {
                    int w = xxx * m + yyy;
                    degree[xxx * m + yyy]--;
                    if (degree[xxx * m + yyy] == 1)
                        queue.add(w);
                }
            }
        }

        boolean ok = true;
        loop: {
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    if (a[i][j] == '.') {
                        ok = false;
                        break loop;
                    }
        }

        if (ok) {
            for (int i = 0; i < n; i++) {
                cout.write(a[i]);
                cout.write("\n");
            }
        } else {
            cout.write("Not unique\n");
        }

        cout.close();
    }

    static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {
        final U _1;
        final V _2;

        private Pair(U key, V val) {
            this._1 = key;
            this._2 = val;
        }

        public static <U extends Comparable<U>, V extends Comparable<V>> Pair<U, V> instanceOf(U _1, V _2) {
            return new Pair<U, V>(_1, _2);
        }

        @Override
        public String toString() {
            return _1 + " " + _2;
        }

        @Override
        public int hashCode() {
            int res = 17;
            res = res * 31 + _1.hashCode();
            res = res * 31 + _2.hashCode();
            return res;
        }

        @Override
        public int compareTo(Pair<U, V> that) {
            int res = this._1.compareTo(that._1);
            if (res < 0 || res > 0)
                return res;
            else
                return this._2.compareTo(that._2);
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (!(obj instanceof Pair))
                return false;
            Pair<?, ?> that = (Pair<?, ?>) obj;
            return _1.equals(that._1) && _2.equals(that._2);
        }
    }

    /** Class for buffered reading int and double values */
    static class Reader {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        /** call this method to initialize reader for InputStream */
        static void init(InputStream input) {
            reader = new BufferedReader(new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        /** get next word */
        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                // TODO add check for eof if necessary
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }

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

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }

    static class ArrayUtil {
        static void swap(int[] a, int i, int j) {
            int tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }

        static void swap(long[] a, int i, int j) {
            long tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }

        static void swap(double[] a, int i, int j) {
            double tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }

        static void swap(char[] a, int i, int j) {
            char tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }

        static void swap(boolean[] a, int i, int j) {
            boolean tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }

        static void reverse(int[] a, int i, int j) {
            for (; i < j; i++, j--)
                swap(a, i, j);
        }

        static void reverse(long[] a, int i, int j) {
            for (; i < j; i++, j--)
                swap(a, i, j);
        }

        static void reverse(double[] a, int i, int j) {
            for (; i < j; i++, j--)
                swap(a, i, j);
        }

        static void reverse(char[] a, int i, int j) {
            for (; i < j; i++, j--)
                swap(a, i, j);
        }

        static void reverse(boolean[] a, int i, int j) {
            for (; i < j; i++, j--)
                swap(a, i, j);
        }

        static long sum(int[] a) {
            int sum = 0;
            for (int i : a)
                sum += i;
            return sum;
        }

        static long sum(long[] a) {
            long sum = 0;
            for (long i : a)
                sum += i;
            return sum;
        }

        static double sum(double[] a) {
            double sum = 0;
            for (double i : a)
                sum += i;
            return sum;
        }

        static int max(int[] a) {
            int max = Integer.MIN_VALUE;
            for (int i : a)
                if (i > max)
                    max = i;
            return max;
        }

        static int min(int[] a) {
            int min = Integer.MAX_VALUE;
            for (int i : a)
                if (i < min)
                    min = i;
            return min;
        }

        static long max(long[] a) {
            long max = Long.MIN_VALUE;
            for (long i : a)
                if (i > max)
                    max = i;
            return max;
        }

        static long min(long[] a) {
            long min = Long.MAX_VALUE;
            for (long i : a)
                if (i < min)
                    min = i;
            return min;
        }
    }
}
