#include <bits/stdc++.h>
using namespace std;
int n, m;
char grid[2000][2000];
vector<vector<int>> directions = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
string head = "<>^v";
string tail = "><v^";
int IsUnique(int i, int j) {
  int res = -1;
  for (int d = 0; d < directions.size(); ++d) {
    auto& dir = directions[d];
    int di = i + dir[0];
    int dj = j + dir[1];
    if (0 <= di && di < n && 0 <= dj && dj < m && grid[di][dj] == '.') {
      if (res == -1) {
        res = d;
      } else {
        return -1;
      }
    }
  }
  return res;
}
void DFS(int i, int j) {
  int res = IsUnique(i, j);
  if (res < 0) {
    return;
  }
  grid[i][j] = head[res];
  int ni = i + directions[res][0];
  int nj = j + directions[res][1];
  grid[ni][nj] = tail[res];
  for (auto& dir : directions) {
    int di = ni + dir[0];
    int dj = nj + dir[1];
    if (0 <= di && di < n && 0 <= dj && dj < m && grid[di][dj] == '.') {
      DFS(di, dj);
    }
  }
}
void GreedyFill() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (grid[i][j] == '.' && IsUnique(i, j) >= 0) {
        DFS(i, j);
      }
    }
  }
}
bool Unique() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (grid[i][j] == '.') {
        return false;
      }
    }
  }
  return true;
}
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      grid[i][j] = getchar();
    }
    getchar();
  }
  GreedyFill();
  if (Unique()) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        printf("%c", grid[i][j]);
      }
      printf("\n");
    }
  } else {
    printf("Not unique\n");
  }
  return 0;
}
