#include <bits/stdc++.h>
using namespace std;
template <class T>
typename T::value_type arr_sum(const T& v, int n) {
  typename T::value_type sum = 0;
  for (int i = (0); i < (n); ++i) sum += v[i];
  return sum;
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
vector<string> v;
int n, m;
int point = 0;
queue<pair<int, int> > angles;
void check(int i, int j) {
  if (v[i][j] != '.') {
    return;
  }
  int c = 0;
  c += v[i][j - 1] == '.';
  c += v[i][j + 1] == '.';
  c += v[i - 1][j] == '.';
  c += v[i + 1][j] == '.';
  if (c == 0) {
    cout << "Not unique"
         << "\n";
    exit(0);
  }
  if (c == 1) {
    angles.push({i, j});
  }
}
void set_domino() {
  while (!angles.empty()) {
    pair<int, int> t = angles.front();
    angles.pop();
    int i = t.first;
    int j = t.second;
    if (v[i][j] != '.') {
      continue;
    }
    if (v[i][j + 1] == '.') {
      point -= 2;
      v[i][j] = '<';
      v[i][j + 1] = '>';
      check(i - 1, j);
      check(i - 1, j + 1);
      check(i + 1, j);
      check(i + 1, j + 1);
      check(i, j - 1);
      check(i, j + 2);
      continue;
    }
    if (v[i][j - 1] == '.') {
      point -= 2;
      v[i][j - 1] = '<';
      v[i][j] = '>';
      check(i - 1, j - 1);
      check(i - 1, j);
      check(i + 1, j - 1);
      check(i + 1, j);
      check(i, j - 2);
      check(i, j + 1);
      continue;
    }
    if (v[i + 1][j] == '.') {
      point -= 2;
      v[i][j] = '^';
      v[i + 1][j] = 'v';
      check(i, j - 1);
      check(i + 1, j - 1);
      check(i, j + 1);
      check(i + 1, j + 1);
      check(i - 1, j);
      check(i + 2, j);
      continue;
    }
    if (v[i - 1][j] == '.') {
      point -= 2;
      v[i - 1][j] = '^';
      v[i][j] = 'v';
      check(i - 1, j - 1);
      check(i, j - 1);
      check(i - 1, j + 1);
      check(i, j + 1);
      check(i - 2, j);
      check(i + 1, j);
      continue;
    }
  }
}
int main() {
  cin >> n >> m;
  n += 2;
  m += 2;
  v.resize(n);
  for (int i = (1); i < (n - 1); ++i) {
    cin >> v[i];
    v[i] = '*' + v[i] + '*';
  }
  for (int i = (0); i < (m); ++i) {
    v[0] += '*';
    v[n - 1] += '*';
  }
  for (int i = (1); i < (n - 1); ++i) {
    for (int j = (1); j < (m - 1); ++j) {
      if (v[i][j] == '.') {
        ++point;
      }
      check(i, j);
    }
  }
  if (point % 2) {
    cout << "Not unique"
         << "\n";
    return 0;
  }
  set_domino();
  if (point != 0) {
    cout << "Not unique"
         << "\n";
    return 0;
  }
  for (int i = (1); i < (n - 1); ++i) {
    for (int j = (1); j < (m - 1); ++j) {
      cout << v[i][j];
    }
    cout << "\n";
  }
}
