#include <bits/stdc++.h>
struct tile {
  int x, y;
  struct tile *next;
};
void push(int, int);
int ways(int, int);
void pair(int, int);
void makeupd(int, int);
void update(int, int);
int left, n, m;
char sc[2005][2005], fucked;
struct tile *head, *tail;
int main() {
  int i, j, k, l;
  fucked = 0;
  head = (struct tile *)malloc(sizeof(struct tile));
  head->next = NULL;
  tail = head;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%s", sc[i]);
  }
  left = 0;
  for (i = 0; i < n && !fucked; i++) {
    for (j = 0; j < m && !fucked; j++) {
      if (sc[i][j] == '.') {
        left++;
        k = ways(j, i);
        if (k == 0) {
          fucked = 1;
        } else if (k == 1) {
          push(j, i);
        }
      }
    }
  }
  while (head->next != NULL && !fucked) {
    pair(head->next->x, head->next->y);
    head->next = head->next->next;
  }
  if (fucked || left) {
    printf("Not unique\n", fucked, left);
  } else {
    for (i = 0; i < n; i++) {
      printf("%s\n", sc[i]);
    }
  }
  return 0;
}
void push(int x, int y) {
  tail->next = (struct tile *)malloc(sizeof(struct tile));
  tail = tail->next;
  tail->x = x;
  tail->y = y;
  tail->next = NULL;
}
int ways(int x, int y) {
  int ret;
  ret = 0;
  if (x > 0 && sc[y][x - 1] == '.') {
    ret++;
  }
  if (y > 0 && sc[y - 1][x] == '.') {
    ret++;
  }
  if (x < m - 1 && sc[y][x + 1] == '.') {
    ret++;
  }
  if (y < n - 1 && sc[y + 1][x] == '.') {
    ret++;
  }
  return ret;
}
void pair(int x, int y) {
  if (sc[y][x] != '.') {
    return;
  }
  if (x > 0 && sc[y][x - 1] == '.') {
    sc[y][x] = '>';
    sc[y][x - 1] = '<';
    makeupd(x, y);
    makeupd(x - 1, y);
  } else if (y > 0 && sc[y - 1][x] == '.') {
    sc[y][x] = 'v';
    sc[y - 1][x] = '^';
    makeupd(x, y);
    makeupd(x, y - 1);
  } else if (x < m - 1 && sc[y][x + 1] == '.') {
    sc[y][x] = '<';
    sc[y][x + 1] = '>';
    makeupd(x, y);
    makeupd(x + 1, y);
  } else if (y < n - 1 && sc[y + 1][x] == '.') {
    sc[y][x] = '^';
    sc[y + 1][x] = 'v';
    makeupd(x, y);
    makeupd(x, y + 1);
  }
  left -= 2;
}
void makeupd(int x, int y) {
  update(x - 1, y);
  update(x, y - 1);
  update(x + 1, y);
  update(x, y + 1);
}
void update(int x, int y) {
  int ws;
  if (0 <= x && x < m && 0 <= y && y < n && sc[y][x] == '.') {
    ws = ways(x, y);
    if (ws == 0) {
      fucked = 1;
    } else if (ws == 1) {
      push(x, y);
    }
  }
}
