func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 2000 + 10;   char s[maxn][maxn];   int deg[maxn][maxn];   int dx[] = {1, 0, -1, 0};   int dy[] = {0, 1, 0, -1};   char fillchar[2][5] = { ^<v> ,  v>^< };   inline int caldeg(int i, int j) {     return (int)(s[i - 1][j] ==  . ) + (int)(s[i + 1][j] ==  . ) +            (int)(s[i][j - 1] ==  . ) + (int)(s[i][j + 1] ==  . );   }   int main() {     int n, m;     scanf( %d %d , &n, &m);     for (int i = 1; i <= n; ++i) {       scanf( %s , s[i] + 1);     }     queue<pair<int, int> > Q;     int cnt = 0;     for (int i = 1; i <= n; ++i) {       for (int j = 1; j <= m; ++j) {         if (s[i][j] ==  . ) {           deg[i][j] = caldeg(i, j);           cnt++;           if (deg[i][j] == 1) Q.push(make_pair(i, j));         }       }     }     if (cnt & 1) {       puts( Not unique );       return 0;     }     while (!Q.empty()) {       pair<int, int> cur = Q.front();       Q.pop();       int x = cur.first;       int y = cur.second;       if (s[x][y] ==  . ) {         int i, nx, ny;         for (i = 0; i < 4; ++i) {           nx = x + dx[i];           ny = y + dy[i];           if (s[nx][ny] ==  . ) break;         }         if (i == 4) {           puts( Not unique );           return 0;         }         s[x][y] = fillchar[0][i];         s[nx][ny] = fillchar[1][i];         deg[x][y] = deg[nx][ny] = 0;         cnt -= 2;         for (i = 0; i < 4; ++i) {           int nnx = nx + dx[i];           int nny = ny + dy[i];           if (s[nnx][nny] ==  . ) {             deg[nnx][nny]--;             if (deg[nnx][nny] == 1) Q.push(make_pair(nnx, nny));           }         }       }     }     if (cnt != 0) {       puts( Not unique );     } else {       for (int i = 1; i <= n; ++i) {         printf( %s n , s[i] + 1);       }     }     return 0;   }   