#include <bits/stdc++.h>
using namespace std;
template <class htpe, class cmp>
using heap = priority_queue<htpe, vector<htpe>, cmp>;
template <class htpe>
using min_heap = heap<htpe, greater<htpe> >;
template <class htpe>
using max_heap = heap<htpe, less<htpe> >;
const int INF = 1791791791;
const long long INFLL = 1791791791791791791ll;
template <size_t buf_size>
class FastInput {
  char buf[buf_size];
  size_t clen = 0;
  size_t cpos = 0;
  FILE *infl;
  bool cl = false;

 public:
  inline bool isEof() {
    if (cpos == clen) {
      cpos = 0;
      clen = fread(buf, 1ul, buf_size, infl);
      return clen == 0;
    } else
      return false;
  }
  inline int nextChar() { return isEof() ? -1 : buf[cpos++]; }
  inline bool seekEof() {
    int res = nextChar();
    while (res == ' ' || res == '\n') res = nextChar();
    if (res == -1) return true;
    assert(cpos != 0);
    cpos--;
    return false;
  }
  inline char readChar() {
    int res = nextChar();
    while (res == ' ' || res == '\n') res = nextChar();
    assert(res != -1);
    return (char)res;
  }
  inline void copyWord(char *wbuf) {
    int w = readChar();
    while (w != ' ' && w != '\n' && w != -1) {
      *(wbuf++) = (char)w;
      w = nextChar();
    }
  }
  inline string readString() {
    int w = readChar();
    std::string res;
    while (w != ' ' && w != '\n' && w != -1) {
      res.push_back((char)w);
      w = nextChar();
    }
    return res;
  }
  template <class rint_t = int>
  rint_t readInt() {
    int sgn = readChar();
    rint_t res = 0, b = 1;
    if (sgn == '-')
      b = -1;
    else if (sgn != '+')
      res = sgn - '0';
    int w = nextChar();
    while (w != ' ' && w != '\n' && w != -1) {
      res *= 10;
      res += w - '0';
      w = nextChar();
    }
    return b * res;
  }
  FastInput(const string &filename = "stdin") {
    cl = filename != "stdin";
    if (filename == "stdin")
      infl = stdin;
    else
      infl = fopen(filename.c_str(), "r");
  }
  ~FastInput() {
    if (cl) fclose(infl);
  }
};
template <size_t buf_size>
class FastOutput {
  char buf[buf_size];
  int cpos = 0;
  FILE *outfl;
  bool lf, cl;

 public:
  inline void flush() {
    fwrite(buf, cpos, 1, outfl);
    cpos = 0;
  }
  inline void putChar(char c) {
    if (cpos == buf_size) flush();
    buf[cpos++] = c;
  }
  inline void putBuf(const char *to_w) {
    while (*to_w != 0) putChar(*(to_w++));
  }
  inline void writeString(const string &s, const char *after = " ") {
    putBuf(s.c_str());
    putBuf(after);
  }
  template <class rint_t>
  inline void writeInt(rint_t x, const char *after = " ") {
    char to_w[100];
    int cur = 0;
    if (x == 0)
      putBuf("0");
    else {
      if (x < 0) {
        putChar('-');
        x = -x;
      }
      while (x > 0) {
        to_w[cur++] = (x % 10) + '0';
        x /= 10;
      }
      reverse(to_w, to_w + cur);
      to_w[cur] = 0;
      putBuf(to_w);
    }
    putBuf(after);
  }
  inline void writeEndl() { putChar('\n'); }
  FastOutput(const string &filename = "stdout", bool lflush = true) {
    lf = lflush;
    cl = filename != "stdout";
    if (filename == "stdout")
      outfl = stdout;
    else
      outfl = fopen(filename.c_str(), "w");
    memset(buf, 0, sizeof(buf));
  }
  ~FastOutput() {
    flush();
    if (cl) fclose(outfl);
  }
};
FastInput<4096> fin;
FastOutput<4096> fout;
const int maxn = 2048;
int n, m;
string field[maxn];
bool iq[maxn][maxn];
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
bool ok(int i, int j) { return 0 <= i && i < n && 0 <= j && j < m; }
int neigh(int i, int j) {
  int ans = 0;
  for (int k = 0; k < ((int)(4)); ++k)
    ans += ok(i + dx[k], j + dy[k]) && (field[i + dx[k]][j + dy[k]] == '.');
  return ans;
}
char put[] = {'v', '^', '>', '<'};
char rev[] = {'^', 'v', '<', '>'};
int main() {
  n = fin.readInt();
  m = fin.readInt();
  for (int i = 0; i < ((int)(n)); ++i) field[i] = fin.readString();
  queue<pair<int, int> > q;
  for (int i = 0; i < ((int)(n)); ++i) {
    for (int j = 0; j < ((int)(m)); ++j) {
      if (field[i][j] == '.' && neigh(i, j) == 1) {
        iq[i][j] = true;
        q.push(make_pair(i, j));
      }
    }
  }
  while (!q.empty()) {
    int i, j;
    tie(i, j) = q.front();
    q.pop();
    if (field[i][j] != '.') continue;
    if (neigh(i, j) != 1) continue;
    int ni = -1, nj = -1;
    for (int k = 0; k < ((int)(4)); ++k) {
      if (ok(i + dx[k], j + dy[k]) && field[i + dx[k]][j + dy[k]] == '.') {
        tie(ni, nj) = make_pair(i + dx[k], j + dy[k]);
        field[i][j] = put[k];
        field[ni][nj] = rev[k];
      }
    }
    if (ni != -1) {
      for (int k = 0; k < ((int)(4)); ++k) {
        if (ok(ni + dx[k], nj + dy[k]) && neigh(ni + dx[k], nj + dy[k]) == 1 &&
            field[ni + dx[k]][nj + dy[k]] == '.') {
          if (!iq[ni + dx[k]][nj + dy[k]]) {
            iq[ni + dx[k]][nj + dy[k]] = true;
            q.push(make_pair(ni + dx[k], nj + dy[k]));
          }
        }
      }
    }
  }
  for (int i = 0; i < ((int)(n)); ++i) {
    for (int j = 0; j < ((int)(m)); ++j)
      if (field[i][j] == '.') {
        fout.writeString("Not unique", "\n");
        return 0;
      }
  }
  for (int i = 0; i < ((int)(n)); ++i) fout.writeString(field[i], "\n");
  return 0;
}

### Prompt

Create a solution in cpp for the following problem:

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".

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class htpe, class cmp>
using heap = priority_queue<htpe, vector<htpe>, cmp>;
template <class htpe>
using min_heap = heap<htpe, greater<htpe> >;
template <class htpe>
using max_heap = heap<htpe, less<htpe> >;
const int INF = 1791791791;
const long long INFLL = 1791791791791791791ll;
template <size_t buf_size>
class FastInput {
  char buf[buf_size];
  size_t clen = 0;
  size_t cpos = 0;
  FILE *infl;
  bool cl = false;

 public:
  inline bool isEof() {
    if (cpos == clen) {
      cpos = 0;
      clen = fread(buf, 1ul, buf_size, infl);
      return clen == 0;
    } else
      return false;
  }
  inline int nextChar() { return isEof() ? -1 : buf[cpos++]; }
  inline bool seekEof() {
    int res = nextChar();
    while (res == ' ' || res == '\n') res = nextChar();
    if (res == -1) return true;
    assert(cpos != 0);
    cpos--;
    return false;
  }
  inline char readChar() {
    int res = nextChar();
    while (res == ' ' || res == '\n') res = nextChar();
    assert(res != -1);
    return (char)res;
  }
  inline void copyWord(char *wbuf) {
    int w = readChar();
    while (w != ' ' && w != '\n' && w != -1) {
      *(wbuf++) = (char)w;
      w = nextChar();
    }
  }
  inline string readString() {
    int w = readChar();
    std::string res;
    while (w != ' ' && w != '\n' && w != -1) {
      res.push_back((char)w);
      w = nextChar();
    }
    return res;
  }
  template <class rint_t = int>
  rint_t readInt() {
    int sgn = readChar();
    rint_t res = 0, b = 1;
    if (sgn == '-')
      b = -1;
    else if (sgn != '+')
      res = sgn - '0';
    int w = nextChar();
    while (w != ' ' && w != '\n' && w != -1) {
      res *= 10;
      res += w - '0';
      w = nextChar();
    }
    return b * res;
  }
  FastInput(const string &filename = "stdin") {
    cl = filename != "stdin";
    if (filename == "stdin")
      infl = stdin;
    else
      infl = fopen(filename.c_str(), "r");
  }
  ~FastInput() {
    if (cl) fclose(infl);
  }
};
template <size_t buf_size>
class FastOutput {
  char buf[buf_size];
  int cpos = 0;
  FILE *outfl;
  bool lf, cl;

 public:
  inline void flush() {
    fwrite(buf, cpos, 1, outfl);
    cpos = 0;
  }
  inline void putChar(char c) {
    if (cpos == buf_size) flush();
    buf[cpos++] = c;
  }
  inline void putBuf(const char *to_w) {
    while (*to_w != 0) putChar(*(to_w++));
  }
  inline void writeString(const string &s, const char *after = " ") {
    putBuf(s.c_str());
    putBuf(after);
  }
  template <class rint_t>
  inline void writeInt(rint_t x, const char *after = " ") {
    char to_w[100];
    int cur = 0;
    if (x == 0)
      putBuf("0");
    else {
      if (x < 0) {
        putChar('-');
        x = -x;
      }
      while (x > 0) {
        to_w[cur++] = (x % 10) + '0';
        x /= 10;
      }
      reverse(to_w, to_w + cur);
      to_w[cur] = 0;
      putBuf(to_w);
    }
    putBuf(after);
  }
  inline void writeEndl() { putChar('\n'); }
  FastOutput(const string &filename = "stdout", bool lflush = true) {
    lf = lflush;
    cl = filename != "stdout";
    if (filename == "stdout")
      outfl = stdout;
    else
      outfl = fopen(filename.c_str(), "w");
    memset(buf, 0, sizeof(buf));
  }
  ~FastOutput() {
    flush();
    if (cl) fclose(outfl);
  }
};
FastInput<4096> fin;
FastOutput<4096> fout;
const int maxn = 2048;
int n, m;
string field[maxn];
bool iq[maxn][maxn];
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
bool ok(int i, int j) { return 0 <= i && i < n && 0 <= j && j < m; }
int neigh(int i, int j) {
  int ans = 0;
  for (int k = 0; k < ((int)(4)); ++k)
    ans += ok(i + dx[k], j + dy[k]) && (field[i + dx[k]][j + dy[k]] == '.');
  return ans;
}
char put[] = {'v', '^', '>', '<'};
char rev[] = {'^', 'v', '<', '>'};
int main() {
  n = fin.readInt();
  m = fin.readInt();
  for (int i = 0; i < ((int)(n)); ++i) field[i] = fin.readString();
  queue<pair<int, int> > q;
  for (int i = 0; i < ((int)(n)); ++i) {
    for (int j = 0; j < ((int)(m)); ++j) {
      if (field[i][j] == '.' && neigh(i, j) == 1) {
        iq[i][j] = true;
        q.push(make_pair(i, j));
      }
    }
  }
  while (!q.empty()) {
    int i, j;
    tie(i, j) = q.front();
    q.pop();
    if (field[i][j] != '.') continue;
    if (neigh(i, j) != 1) continue;
    int ni = -1, nj = -1;
    for (int k = 0; k < ((int)(4)); ++k) {
      if (ok(i + dx[k], j + dy[k]) && field[i + dx[k]][j + dy[k]] == '.') {
        tie(ni, nj) = make_pair(i + dx[k], j + dy[k]);
        field[i][j] = put[k];
        field[ni][nj] = rev[k];
      }
    }
    if (ni != -1) {
      for (int k = 0; k < ((int)(4)); ++k) {
        if (ok(ni + dx[k], nj + dy[k]) && neigh(ni + dx[k], nj + dy[k]) == 1 &&
            field[ni + dx[k]][nj + dy[k]] == '.') {
          if (!iq[ni + dx[k]][nj + dy[k]]) {
            iq[ni + dx[k]][nj + dy[k]] = true;
            q.push(make_pair(ni + dx[k], nj + dy[k]));
          }
        }
      }
    }
  }
  for (int i = 0; i < ((int)(n)); ++i) {
    for (int j = 0; j < ((int)(m)); ++j)
      if (field[i][j] == '.') {
        fout.writeString("Not unique", "\n");
        return 0;
      }
  }
  for (int i = 0; i < ((int)(n)); ++i) fout.writeString(field[i], "\n");
  return 0;
}

```