#include <bits/stdc++.h>
using namespace std;
char mt[2005][2005];
int d[2005][2005];
bool vis[2005][2005];
int n, m;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
vector<pair<int, int> > p;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", mt[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (mt[i][j] == '.') {
        for (int k = 0; k < 4; k++) {
          int u = i + dx[k];
          int v = j + dy[k];
          if (u < 0 || u >= n || v < 0 || v >= m || mt[u][v] != '.') continue;
          d[i][j]++;
        }
        if (d[i][j] == 1) p.push_back(make_pair(i, j));
      }
  while (1) {
    if (!p.size()) break;
    int i = p[0].first;
    int j = p[0].second;
    swap(p[0], p[p.size() - 1]);
    p.pop_back();
    if (vis[i][j]) continue;
    vis[i][j] = 1;
    bool f = 1;
    for (int k = 0; k < 4; k++) {
      int u = i + dx[k];
      int v = j + dy[k];
      if (u < 0 || u >= n || v < 0 || v >= m || mt[u][v] != '.' || vis[u][v])
        continue;
      f = 0;
      if (k == 0) {
        mt[i][j] = '^';
        mt[u][v] = 'v';
      } else if (k == 1) {
        mt[i][j] = 'v';
        mt[u][v] = '^';
      }
      if (k == 2) {
        mt[i][j] = '<';
        mt[u][v] = '>';
      }
      if (k == 3) {
        mt[i][j] = '>';
        mt[u][v] = '<';
      }
      vis[u][v] = 1;
      for (int q = 0; q < 4; q++) {
        int a = u + dx[q];
        int b = v + dy[q];
        if (a < 0 || a >= n || b < 0 || b >= m || mt[a][b] != '.' || vis[a][b])
          continue;
        d[a][b]--;
        if (d[a][b] == 1) p.push_back(make_pair(a, b));
      }
    }
    if (f) {
      printf("Not unique");
      return 0;
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (mt[i][j] == '.' && !vis[i][j]) {
        printf("Not unique");
        return 0;
      }
  for (int i = 0; i < n; i++) printf("%s\n", mt[i]);
}
