#include <bits/stdc++.h>
using namespace std;
queue<pair<int, int> > q;
const int nmax = 2005;
const string ns = "Not unique\n";
const int dx[] = {0, 0, -1, 1};
const int dy[] = {1, -1, 0, 0};
char s[nmax][nmax];
int g[nmax][nmax];
int main(void) {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (s[i][j] == '.') {
        int fx, fy;
        for (int p = 0; p < 4; ++p) {
          fx = i + dx[p];
          fy = j + dy[p];
          if (s[fx][fy] == '.') ++g[i][j];
        }
        if (g[i][j] == 1) q.push(make_pair(i, j));
      }
  while (q.size()) {
    int fx = q.front().first;
    int fy = q.front().second;
    --g[fx][fy];
    q.pop();
    int pos = -1;
    for (int p = 0; p < 4; ++p) {
      int fxx = fx + dx[p];
      int fyy = fy + dy[p];
      if (s[fxx][fyy] == '.') pos = p;
    }
    if (pos == -1 && s[fx][fy] == '.') return cout << ns, 0;
    if (s[fx][fy] == '.') {
      if (!pos)
        s[fx][fy] = '<', s[fx][fy + 1] = '>';
      else if (pos == 1)
        s[fx][fy] = '>', s[fx][fy - 1] = '<';
      else if (pos == 2)
        s[fx][fy] = 'v', s[fx - 1][fy] = '^';
      else
        s[fx][fy] = '^', s[fx + 1][fy] = 'v';
      fx += dx[pos];
      fy += dy[pos];
      --g[fx][fy];
      for (int p = 0; p < 4; ++p) {
        int fxx = fx + dx[p];
        int fyy = fy + dy[p];
        if (s[fxx][fyy] == '.') --g[fxx][fyy];
        if (s[fxx][fyy] == '.' && g[fxx][fyy] == 1) q.push(make_pair(fxx, fyy));
      }
    }
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (s[i][j] == '.') return cout << ns, 0;
  for (int i = 1; i <= n; ++i) cout << (s[i] + 1) << '\n';
  return 0;
}
