#include <bits/stdc++.h>
using namespace std;
int val[2023][2023];
int done[2023][2023];
priority_queue<pair<int, pair<int, pair<int, int> > >,
               vector<pair<int, pair<int, pair<int, int> > > >,
               greater<pair<int, pair<int, pair<int, int> > > > >
    pq;
int n, m;
string s[2023];
void red(int i, int j) {
  if (i > 0 and s[i - 1][j] == '.') {
    val[i - 1][j]--;
    done[i - 1][j]++;
    if (val[i - 1][j] == 1)
      pq.push(make_pair(val[i - 1][j],
                        make_pair(done[i - 1][j], make_pair(i - 1, j))));
  }
  if (j > 0 and s[i][j - 1] == '.') {
    val[i][j - 1]--;
    done[i][j - 1]++;
    if (val[i][j - 1] == 1)
      pq.push(make_pair(val[i][j - 1],
                        make_pair(done[i][j - 1], make_pair(i, j - 1))));
  }
  if (i < n - 1 and s[i + 1][j] == '.') {
    val[i + 1][j]--;
    done[i + 1][j]++;
    if (val[i + 1][j] == 1)
      pq.push(make_pair(val[i + 1][j],
                        make_pair(done[i + 1][j], make_pair(i + 1, j))));
  }
  if (j < m - 1 and s[i][j + 1] == '.') {
    val[i][j + 1]--;
    done[i][j + 1]++;
    if (val[i][j + 1] == 1)
      pq.push(make_pair(val[i][j + 1],
                        make_pair(done[i][j + 1], make_pair(i, j + 1))));
  }
}
int main() {
  cin >> n >> m;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (s[i][j] == '.') cnt++;
  if ((cnt & 1)) {
    cout << "Not unique\n";
    return 0;
  }
  if (cnt == 0) {
    for (int i = 0; i < n; i++) cout << s[i] << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '.') {
        if (i > 0 and s[i - 1][j] == '.') val[i][j]++;
        if (j > 0 and s[i][j - 1] == '.') val[i][j]++;
        if (i < n - 1 and s[i + 1][j] == '.') val[i][j]++;
        if (j < m - 1 and s[i][j + 1] == '.') val[i][j]++;
        if (val[i][j] == 1)
          pq.push(make_pair(val[i][j], make_pair(0, make_pair(i, j))));
      }
    }
  }
  bool bad = true;
  while (!pq.empty()) {
    auto u = pq.top();
    pq.pop();
    if (s[u.second.second.first][u.second.second.second] != '.') continue;
    if (u.first == 1) {
      bad = false;
      if (u.second.second.first > 0 and
          s[u.second.second.first - 1][u.second.second.second] == '.') {
        red(u.second.second.first - 1, u.second.second.second);
        s[u.second.second.first][u.second.second.second] = 'v';
        s[u.second.second.first - 1][u.second.second.second] = '^';
      } else if (u.second.second.second > 0 and
                 s[u.second.second.first][u.second.second.second - 1] == '.') {
        red(u.second.second.first, u.second.second.second - 1);
        s[u.second.second.first][u.second.second.second] = '>';
        s[u.second.second.first][u.second.second.second - 1] = '<';
      } else if (u.second.second.first < n - 1 and
                 s[u.second.second.first + 1][u.second.second.second] == '.') {
        red(u.second.second.first + 1, u.second.second.second);
        s[u.second.second.first][u.second.second.second] = '^';
        s[u.second.second.first + 1][u.second.second.second] = 'v';
      } else if (u.second.second.second < m - 1 and
                 s[u.second.second.first][u.second.second.second + 1] == '.') {
        red(u.second.second.first, u.second.second.second + 1);
        s[u.second.second.first][u.second.second.second] = '<';
        s[u.second.second.first][u.second.second.second + 1] = '>';
      }
    } else {
      cout << "Not unique\n";
      return 0;
    }
  }
  if (bad) {
    cout << "Not unique\n";
    return 0;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (s[i][j] == '.') {
        cout << "Not unique" << endl;
        return 0;
      }
  for (int i = 0; i < n; i++) cout << s[i] << endl;
  return 0;
}
