#include <bits/stdc++.h>
using namespace std;
queue<pair<pair<int, int>, pair<int, int> > > cola;
pair<pair<int, int>, pair<int, int> > aux;
char mat[2005][2005], car;
int n, m, i, j, w, b, u, v, uu, vv, aa, bb;
void check(int a, int b) {
  int u, v, uu, vv, wb = 0;
  if (mat[a][b] == '.') {
    for (u = -1; u <= 1; u++) {
      for (v = -1; v <= 1; v++) {
        if (u * v == 0 && u != v) {
          if (mat[a + u][b + v] != '.')
            wb++;
          else {
            uu = u;
            vv = v;
          }
        }
      }
    }
    if (wb == 3) {
      cola.push(make_pair(make_pair(a, b), make_pair(uu, vv)));
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%c", &car);
  for (i = 0; i <= n + 1; i++) {
    for (j = 0; j <= m + 1; j++) {
      if (i == 0 || i == n + 1 || j == 0 || j == m + 1) {
        mat[i][j] = '*';
        if (j == m + 1 && i >= 1 && i <= n) scanf("%c", &car);
      } else {
        scanf("%c", &mat[i][j]);
        if (mat[i][j] == '.') {
          if ((i + j) % 2 == 0)
            b++;
          else
            w++;
        }
      }
    }
  }
  if (w != b) {
    printf("Not unique\n");
    return 0;
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      check(i, j);
    }
  }
  while (!cola.empty()) {
    aux = cola.front();
    cola.pop();
    uu = aux.second.first;
    vv = aux.second.second;
    aa = aux.first.first;
    bb = aux.first.second;
    if (uu == 0 && vv == -1) {
      if (mat[aa][bb] == '.' || mat[aa][bb] == '>')
        mat[aa][bb] = '>';
      else
        break;
      if (mat[aa + uu][bb + vv] == '.' || mat[aa + uu][bb + vv] == '<')
        mat[aa + uu][bb + vv] = '<';
      else
        break;
    }
    if (uu == 0 && vv == 1) {
      if (mat[aa][bb] == '.' || mat[aa][bb] == '<')
        mat[aa][bb] = '<';
      else
        break;
      if (mat[aa + uu][bb + vv] == '.' || mat[aa + uu][bb + vv] == '>')
        mat[aa + uu][bb + vv] = '>';
      else
        break;
    }
    if (uu == -1 && vv == 0) {
      if (mat[aa][bb] == '.' || mat[aa][bb] == 'v')
        mat[aa][bb] = 'v';
      else
        break;
      if (mat[aa + uu][bb + vv] == '.' || mat[aa + uu][bb + vv] == '^')
        mat[aa + uu][bb + vv] = '^';
      else
        break;
    }
    if (uu == 1 && vv == 0) {
      if (mat[aa][bb] == '.' || mat[aa][bb] == '^')
        mat[aa][bb] = '^';
      else
        break;
      if (mat[aa + uu][bb + vv] == '.' || mat[aa + uu][bb + vv] == 'v')
        mat[aa + uu][bb + vv] = 'v';
      else
        break;
    }
    check(aa + 1, bb);
    check(aa - 1, bb);
    check(aa, bb + 1);
    check(aa, bb - 1);
    check(aa + uu + 1, bb + vv);
    check(aa + uu - 1, bb + vv);
    check(aa + uu, bb + vv + 1);
    check(aa + uu, bb + vv + -1);
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (mat[i][j] == '.') {
        printf("Not unique\n");
        return 0;
      }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      printf("%c", mat[i][j]);
    }
    printf("\n");
  }
  return 0;
}
