#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2005;
char table[MAXN][MAXN];
char newtable[MAXN][MAXN];
int n, m;
bool mark() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (table[i][j] != '.') {
        continue;
      }
      if (table[i][j + 1] == '.') {
        table[i][j] = '<';
        table[i][j + 1] = '>';
        continue;
      }
      if (table[i + 1][j] == '.') {
        table[i][j] = '^';
        table[i + 1][j] = 'v';
        continue;
      }
      return false;
    }
  }
  return true;
}
bool remark() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (newtable[i][j] != '.') {
        continue;
      }
      if (newtable[i + 1][j] == '.') {
        newtable[i][j] = '^';
        newtable[i + 1][j] = 'v';
        continue;
      }
      if (newtable[i][j + 1] == '.') {
        newtable[i][j] = '<';
        newtable[i][j + 1] = '>';
        continue;
      }
      return false;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (newtable[i][j] != table[i][j]) {
        return false;
      }
    }
  }
  return true;
}
queue<pair<pair<int, int>, int> > que;
pair<pair<int, int>, int> mp(int a, int b, int c) {
  return make_pair(make_pair(a, b), c);
}
int step[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
pair<int, int> get(int x, int y) {
  int ct = 0;
  int dir = -1;
  for (int i = 0; i < 4; ++i) {
    int nx = x + step[i][0];
    int ny = y + step[i][1];
    if (table[nx][ny] == '.') {
      ++ct;
      dir = i;
    }
  }
  return make_pair(ct, dir);
}
bool check() {
  int sum = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (table[i][j] != '.') {
        continue;
      }
      ++sum;
      pair<int, int> tmp = get(i, j);
      if (tmp.first == 1) {
        que.push(mp(i, j, tmp.second));
      }
    }
  }
  while (que.size()) {
    pair<pair<int, int>, int> tmp = que.front();
    que.pop();
    int nx = tmp.first.first + step[tmp.second][0],
        ny = tmp.first.second + step[tmp.second][1];
    if (table[nx][ny] != '.') {
      continue;
    }
    sum -= 2;
    if (nx == tmp.first.first) {
      table[nx][min(tmp.first.second, ny)] = '<';
      table[nx][max(tmp.first.second, ny)] = '>';
    } else {
      table[min(tmp.first.first, nx)][ny] = '^';
      table[max(tmp.first.first, nx)][ny] = 'v';
    }
    for (int i = 0; i < 4; ++i) {
      int sx = nx + step[i][0], sy = ny + step[i][1];
      if (table[sx][sy] != '.') {
        continue;
      }
      pair<int, int> delta = get(sx, sy);
      if (delta.first == 1) {
        que.push(mp(sx, sy, delta.second));
      }
    }
  }
  return sum == 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", table[i] + 1);
  }
  memcpy(newtable, table, sizeof(table));
  if (check()) {
    for (int i = 1; i <= n; ++i) {
      puts(table[i] + 1);
    }
  } else {
    puts("Not unique");
  }
}
