#include <bits/stdc++.h>
using namespace std;
int n, m;
char dat[2047][2047];
char deg[2047][2047];
const int dir[4][2] = {0, 1, 0, -1, 1, 0, -1, 0};
queue<pair<int, int>> q;
char impossible[] = "Not unique";
void decrease_cell(int r, int c) {
  for (int i = 0; i < 4; i++) {
    int nr = r + dir[i][0];
    int nc = c + dir[i][1];
    if (nr < 0 || nc < 0 || nr >= n || nc >= m) continue;
    if (dat[nr][nc] == '.') {
      deg[nr][nc]--;
      if (deg[nr][nc] == 1) {
        q.push(make_pair(nr, nc));
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", dat[i]);
  int blankcnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (dat[i][j] == '.') {
        blankcnt++;
        for (int k = 0; k < 4; k++) {
          int nr = i + dir[k][0];
          int nc = j + dir[k][1];
          if (nr < 0 || nc < 0 || nr >= n || nc >= m) continue;
          if (dat[nr][nc] == '.') {
            deg[i][j]++;
          }
        }
        if (deg[i][j] == 0) {
          puts(impossible);
          return 0;
        }
        if (deg[i][j] == 1) {
          q.push(make_pair(i, j));
        }
      }
    }
  }
  while (!q.empty()) {
    auto r = q.front().first;
    auto c = q.front().second;
    q.pop();
    if (deg[r][c] != 1) continue;
    if (dat[r][c] != '.') continue;
    for (int d = 0; d < 4; d++) {
      int nr = r + dir[d][0];
      int nc = c + dir[d][1];
      if (nr < 0 || nc < 0 || nr >= n || nc >= m) continue;
      if (dat[nr][nc] == '.') {
        if (d == 0) {
          dat[r][c] = '<';
          dat[r][c + 1] = '>';
        } else if (d == 1) {
          dat[r][c - 1] = '<';
          dat[r][c] = '>';
        } else if (d == 2) {
          dat[r][c] = '^';
          dat[r + 1][c] = 'v';
        } else {
          dat[r - 1][c] = '^';
          dat[r][c] = 'v';
        }
        deg[r][c] = 0;
        deg[nr][nc] = 0;
        decrease_cell(r, c);
        decrease_cell(nr, nc);
        blankcnt--;
        blankcnt--;
        break;
      }
    }
  }
  if (blankcnt != 0) {
    puts(impossible);
    return 0;
  }
  for (int i = 0; i < n; i++) puts(dat[i]);
  return 0;
}
