#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const int maxn = 2100;
int n, m;
int mapp[maxn][maxn];
int mask[maxn][maxn];
int cnt[maxn * maxn];
inline bool valid(int r, int c) {
  if (r >= 0 && c >= 0 && r <= n - 1 && c <= m - 1 && mapp[r][c] == 0) {
    return true;
  }
  return false;
}
bool check() {
  int cmp = 1;
  memset(mask, 0, sizeof(mask));
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mapp[i][j] == 0 && mask[i][j] == 0) {
        queue<pair<int, int> > q;
        q.push(make_pair(i, j));
        mask[i][j] = cmp;
        cnt[cmp]++;
        while (!q.empty()) {
          pair<int, int> cur = q.front();
          q.pop();
          int r = cur.first;
          int c = cur.second;
          if (r + 1 < n && mask[r + 1][c] == 0 && mapp[r + 1][c] == 0) {
            q.push(make_pair(r + 1, c));
            mask[r + 1][c] = cmp;
            cnt[cmp]++;
          }
          if (c + 1 < m && mask[r][c + 1] == 0 && mapp[r][c + 1] == 0) {
            q.push(make_pair(r, c + 1));
            mask[r][c + 1] = cmp;
            cnt[cmp]++;
          }
          if (r > 0 && mask[r - 1][c] == 0 && mapp[r - 1][c] == 0) {
            q.push(make_pair(r - 1, c));
            mask[r - 1][c] = cmp;
            cnt[cmp]++;
          }
          if (c > 0 && mask[r][c - 1] == 0 && mapp[r][c - 1] == 0) {
            q.push(make_pair(r, c - 1));
            mask[r][c - 1] = cmp;
            cnt[cmp]++;
          }
        }
        cmp++;
      }
    }
  }
  bool fail = false;
  for (int i = 1; i < cmp; i++) {
    if (cnt[i] % 2 == 1) {
      fail = true;
      break;
    }
  }
  return !fail;
}
int main() {
  std::ios::sync_with_stdio(false);
  int x;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) {
      mapp[i][j] = (s[j] == '.') ? 0 : 1;
      x += 1 - mapp[i][j];
    }
  }
  if (x % 2 == 1 || !check()) {
    cout << "Not unique" << '\n';
    return 0;
  }
  queue<pair<int, int> > q;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mapp[i][j] == 0) {
        q.push(make_pair(i, j));
      }
    }
  }
  while (!q.empty()) {
    pair<int, int> cur = q.front();
    q.pop();
    int i = cur.first;
    int j = cur.second;
    if (i < 0 || j < 0 || i > n - 1 || j > m - 1) continue;
    if (mapp[i][j] == 0) {
      if ((i == 0 || mapp[i - 1][j] != 0) && (j == 0 || mapp[i][j - 1] != 0) &&
          (j == m - 1 || mapp[i][j + 1] != 0) && i < n - 1 &&
          mapp[i + 1][j] == 0) {
        mapp[i][j] = 2;
        mapp[i + 1][j] = 3;
        for (int dx = -1; dx <= 1; dx++)
          for (int dy = -1; dy <= 1; dy++) {
            if (valid(i + dx, j + dy)) q.push(make_pair(i + dx, j + dy));
            if (valid(i + 1 + dx, j + dy))
              q.push(make_pair(i + 1 + dx, j + dy));
          }
      }
      if ((i == n - 1 || mapp[i + 1][j] != 0) &&
          (j == 0 || mapp[i][j - 1] != 0) &&
          (j == m - 1 || mapp[i][j + 1] != 0) && i > 0 && mapp[i - 1][j] == 0) {
        mapp[i][j] = 3;
        mapp[i - 1][j] = 2;
        for (int dx = -1; dx <= 1; dx++)
          for (int dy = -1; dy <= 1; dy++) {
            if (valid(i + dx, j + dy)) q.push(make_pair(i + dx, j + dy));
            if (valid(i - 1 + dx, j + dy))
              q.push(make_pair(i - 1 + dx, j + dy));
          }
      }
      if ((i == 0 || mapp[i - 1][j] != 0) && (j == 0 || mapp[i][j - 1] != 0) &&
          (i == n - 1 || mapp[i + 1][j] != 0) && j < m - 1 &&
          mapp[i][j + 1] == 0) {
        mapp[i][j] = 4;
        mapp[i][j + 1] = 5;
        for (int dx = -1; dx <= 1; dx++)
          for (int dy = -1; dy <= 1; dy++) {
            if (valid(i + dx, j + dy)) q.push(make_pair(i + dx, j + dy));
            if (valid(i + dx, j + 1 + dy))
              q.push(make_pair(i + dx, j + 1 + dy));
          }
      }
      if ((i == 0 || mapp[i - 1][j] != 0) &&
          (j == m - 1 || mapp[i][j + 1] != 0) &&
          (i == n - 1 || mapp[i + 1][j] != 0) && j > 0 && mapp[i][j - 1] == 0) {
        mapp[i][j] = 5;
        mapp[i][j - 1] = 4;
        for (int dx = -1; dx <= 1; dx++)
          for (int dy = -1; dy <= 1; dy++) {
            if (valid(i + dx, j + dy)) q.push(make_pair(i + dx, j + dy));
            if (valid(i + dx, j - 1 + dy))
              q.push(make_pair(i + dx, j - 1 + dy));
          }
      }
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (mapp[i][j] == 0) {
        cout << "Not unique" << '\n';
        return 0;
      }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      switch (mapp[i][j]) {
        case 0:
          cout << ".";
          break;
        case 1:
          cout << "*";
          break;
        case 2:
          cout << "^";
          break;
        case 3:
          cout << "v";
          break;
        case 4:
          cout << "<";
          break;
        case 5:
          cout << ">";
          break;
      }
    }
    cout << '\n';
  }
  return 0;
}
