#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
const int INF = 0x3f3f3f3f;
const double EPS = 1e-8;
const int maxn = 2000 + 10;
int n, m;
char st[maxn][maxn];
int num[maxn][maxn];
int cnt;
vector<int> edge[maxn * maxn];
int d[maxn * maxn];
queue<int> que;
int flag[maxn * maxn];
int main() {
  scanf("%d%d", &n, &m);
  cnt = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", st[i]);
    for (int j = 0; j < m; j++) num[i][j] = cnt++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (st[i][j] == '.') {
        if (i > 0 && st[i - 1][j] == '.')
          edge[num[i][j]].push_back(num[i - 1][j]);
        if (i < n - 1 && st[i + 1][j] == '.')
          edge[num[i][j]].push_back(num[i + 1][j]);
        if (j > 0 && st[i][j - 1] == '.')
          edge[num[i][j]].push_back(num[i][j - 1]);
        if (j < m - 1 && st[i][j + 1] == '.')
          edge[num[i][j]].push_back(num[i][j + 1]);
      } else {
        flag[num[i][j]] = -1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      d[num[i][j]] = edge[num[i][j]].size();
      if (d[num[i][j]] == 1) que.push(num[i][j]);
    }
  }
  int cur = 1;
  while (!que.empty()) {
    int vis = que.front();
    que.pop();
    if (flag[vis] || d[vis] != 1) continue;
    flag[vis] = cur;
    for (int i = 0; i < edge[vis].size(); i++) {
      int y = edge[vis][i];
      if (!flag[y]) {
        flag[y] = cur++;
        for (int j = 0; j < edge[y].size(); j++) {
          if (flag[edge[y][j]]) continue;
          d[edge[y][j]]--;
          if (d[edge[y][j]] == 1) que.push(edge[y][j]);
        }
      }
    }
  }
  bool ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (flag[num[i][j]] == 0) ans = 1;
    }
  }
  if (ans)
    puts("Not unique");
  else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (flag[num[i][j]] == -1)
          putchar('*');
        else if (i > 0 && flag[num[i - 1][j]] == flag[num[i][j]])
          putchar('v');
        else if (i < n - 1 && flag[num[i + 1][j]] == flag[num[i][j]])
          putchar('^');
        else if (j > 0 && flag[num[i][j - 1]] == flag[num[i][j]])
          putchar('>');
        else if (j < m - 1 && flag[num[i][j + 1]] == flag[num[i][j]])
          putchar('<');
      }
      puts("");
    }
  }
  return 0;
}
