#include <bits/stdc++.h>
using namespace std;
stack<pair<int, int> > st;
int n, m, sp;
char a[2005][2005];
int check(int x, int y) {
  if (x == 0 || y == 0 || x == n + 1 || y == m + 1) return -1;
  int acc = 0;
  if (a[x + 1][y] != '.') acc++;
  if (a[x - 1][y] != '.') acc++;
  if (a[x][y + 1] != '.') acc++;
  if (a[x][y - 1] != '.') acc++;
  return acc;
}
bool place(int x, int y) {
  if (check(x, y) == 4) return true;
  sp -= 2;
  if (a[x + 1][y] == '.') {
    a[x][y] = '^';
    a[x + 1][y] = 'v';
    if (check(x + 2, y) == 3) st.push(make_pair(x + 2, y));
    if (check(x + 1, y + 1) == 3) st.push(make_pair(x + 1, y + 1));
    if (check(x + 1, y - 1) == 3) st.push(make_pair(x + 1, y - 1));
    return false;
  }
  if (a[x - 1][y] == '.') {
    a[x][y] = 'v';
    a[x - 1][y] = '^';
    if (check(x - 2, y) == 3) st.push(make_pair(x - 2, y));
    if (check(x - 1, y + 1) == 3) st.push(make_pair(x - 1, y + 1));
    if (check(x - 1, y - 1) == 3) st.push(make_pair(x - 1, y - 1));
    return false;
  }
  if (a[x][y + 1] == '.') {
    a[x][y] = '<';
    a[x][y + 1] = '>';
    if (check(x, y + 2) == 3) st.push(make_pair(x, y + 2));
    if (check(x + 1, y + 1) == 3) st.push(make_pair(x + 1, y + 1));
    if (check(x - 1, y + 1) == 3) st.push(make_pair(x - 1, y + 1));
    return false;
  }
  if (a[x][y - 1] == '.') {
    a[x][y] = '>';
    a[x][y - 1] = '<';
    if (check(x, y - 2) == 3) st.push(make_pair(x, y - 2));
    if (check(x + 1, y - 1) == 3) st.push(make_pair(x + 1, y - 1));
    if (check(x - 1, y - 1) == 3) st.push(make_pair(x - 1, y - 1));
    return false;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i <= n + 1; i++) a[i][0] = '*';
  for (int i = 0; i <= n + 1; i++) a[i][m + 1] = '*';
  for (int i = 0; i <= m + 1; i++) a[0][i] = '*';
  for (int i = 0; i <= m + 1; i++) a[n + 1][i] = '*';
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == '.') {
        if (check(i, j) == 3) st.push(pair<int, int>(i, j));
        sp++;
      }
  if (sp % 2) {
    cout << "Not unique";
    return 0;
  }
  pair<int, int> pos;
  while (!st.empty()) {
    pos = st.top();
    st.pop();
    if (a[pos.first][pos.second] == '.') {
      if (place(pos.first, pos.second)) {
        cout << "Not unique";
        return 0;
      }
    }
  }
  if (sp)
    cout << "Not unique";
  else {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) cout << a[i][j];
      cout << endl;
      ;
    }
  }
  return 0;
}
