func_code_string: #include <bits/stdc++.h>   using namespace std;   char a[2000][2000];   const int dx[4] = {-1, 0, 1, 0};   const int dy[4] = {0, -1, 0, 1};   queue<pair<int, int> > que;   int main() {     int n, m;     while (~scanf( %d %d , &n, &m)) {       for (int i = 0; i < n; i++) {         getchar();         for (int j = 0; j < m; j++) {           a[i][j] = getchar();         }       }       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++) {           int cnt = 0;           for (int k = 0; k < 4; k++) {             int ni = i + dx[k];             int nj = j + dy[k];             if (ni >= 0 && ni < n && nj >= 0 && nj < m && a[ni][nj] ==  . ) {               cnt++;             }           }           if (cnt == 1) {             que.push({i, j});           }         }       }       while (!que.empty()) {         pair<int, int> p = que.front();         que.pop();         int i = p.first, j = p.second, k, ni, nj;         if (a[i][j] !=  . ) {           continue;         }         for (k = 0; k < 4; k++) {           ni = i + dx[k];           nj = j + dy[k];           if (ni >= 0 && ni < n && nj >= 0 && nj < m && a[ni][nj] ==  . ) {             break;           }         }         if (k == 0) {           a[i][j] =  v ;           a[i - 1][j] =  ^ ;         } else if (k == 1) {           a[i][j] =  > ;           a[i][j - 1] =  < ;         } else if (k == 2) {           a[i][j] =  ^ ;           a[i + 1][j] =  v ;         } else if (k == 3) {           a[i][j] =  < ;           a[i][j + 1] =  > ;         } else {           continue;         }         for (int k = 0; k < 4; k++) {           int mi = ni + dx[k];           int mj = nj + dy[k];           if (mi >= 0 && mi < n && mj >= 0 && mj < m && a[mi][mj] ==  . ) {             int cnt = 0;             for (int k = 0; k < 4; k++) {               int pi = mi + dx[k];               int pj = mj + dy[k];               if (pi >= 0 && pi < n && pj >= 0 && pj < m && a[pi][pj] ==  . ) {                 cnt++;               }             }             if (cnt == 1) {               que.push({mi, mj});             }           }         }       }       bool flag = false;       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++) {           if (a[i][j] ==  . ) {             flag = true;             break;           }         }         if (flag) {           printf( Not unique n );           break;         }       }       if (!flag) {         for (int i = 0; i < n; i++) {           for (int j = 0; j < m; j++) {             putchar(a[i][j]);           }           putchar(10);         }       }     }     return 0;   }   