#include <bits/stdc++.h>
using namespace std;
int n, m, tot, sum;
int dx[] = {-1, +0, +1, +0};
int dy[] = {+0, +1, +0, -1};
bool check(int x, int y) {
  if (x < 0 || x >= n) return 0;
  if (y < 0 || y >= m) return 0;
  return 1;
}
struct node {
  int x, y;
  void make(int a, int b) {
    x = a;
    y = b;
  }
};
queue<node> Q;
int val(int x, int y) { return x * m + y; }
char graph[2002][2002];
bool visit[2002][2002];
char deg[4000010];
bool gr[4000010][4];
char ss[4000010];
void OMG(int x, int y) {
  int i;
  for (i = 0; i < 4; i++) {
    int a = x + dx[i];
    int b = y + dy[i];
    if (check(a, b) && graph[a][b] == '.') {
      deg[val(x, y)]++;
      gr[val(x, y)][i] = 1;
    }
  }
  node tmp;
  tmp.make(x, y);
  if (deg[val(x, y)] == 1) Q.push(tmp);
}
int bfs(node s) {
  visit[s.x][s.y] = 1;
  int cnt = 1, i;
  queue<node> q;
  q.push(s);
  while (!q.empty()) {
    node u = q.front();
    OMG(u.x, u.y);
    q.pop();
    for (i = 0; i < 4; i++) {
      int x = u.x + dx[i];
      int y = u.y + dy[i];
      node tmp;
      tmp.make(x, y);
      if (check(x, y) && graph[x][y] == '.') {
        if (visit[x][y] == 0) {
          visit[x][y] = 1;
          cnt++;
          q.push(tmp);
        }
      }
    }
  }
  tot += cnt;
  return cnt;
}
bool oka() {
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (graph[i][j] == '.' && visit[i][j] == 0) {
        node tmp;
        tmp.make(i, j);
        int my = bfs(tmp);
        if (my & 1) return 0;
      }
    }
  }
  return 1;
}
struct shit {
  int x, y;
  void make(int a, int b) {
    x = a;
    y = b;
  }
};
void fuck(int ind) {
  int i, cnt = 0;
  for (i = 0; i < 4; i++) {
    if (gr[ind][i]) {
      int v = ((ind / m) + dx[i]) * m + (ind % m) + dy[i];
      cnt++;
      deg[v]--;
      node tmp;
      tmp.make((ind / m) + dx[i], (ind % m) + dy[i]);
      if (deg[v] == 1) Q.push(tmp);
      gr[ind][i] = 0;
      gr[v][(i + 6) % 4] = 0;
    }
  }
  deg[ind] = 0;
}
void destroy(int ind) {
  for (int i = 0; i < 4; i++) {
    if (gr[ind][i]) {
      int v = ((ind / m) + dx[i]) * m + (ind % m) + dy[i];
      fuck(v);
      shit tmp;
      tmp.make(ind, v);
      int x1 = tmp.x / m;
      int y1 = tmp.x % m;
      int x2 = tmp.y / m;
      int y2 = tmp.y % m;
      if (x1 == x2) {
        if (y1 < y2) {
          graph[x1][y1] = '<';
          graph[x2][y2] = '>';
        } else {
          graph[x1][y1] = '>';
          graph[x2][y2] = '<';
        }
      } else {
        if (x1 < x2) {
          graph[x1][y1] = '^';
          graph[x2][y2] = 'v';
        } else {
          graph[x1][y1] = 'v';
          graph[x2][y2] = '^';
        }
      }
      sum += 2;
      break;
    }
  }
}
void Print() {
  int i;
  for (i = 0; i < n; i++) printf("%s\n", graph[i]);
}
bool fun() {
  while (!Q.empty()) {
    node my = Q.front();
    Q.pop();
    destroy(my.x * m + my.y);
  }
  if (tot == sum)
    return 1;
  else
    return 0;
}
int main() {
  int i, j;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) scanf("%s", graph[i]);
  bool o = oka();
  if (o) {
    bool my = fun();
    if (my) {
      Print();
    } else
      printf("Not unique");
  } else
    printf("Not unique");
  return 0;
}
