func_code_string: #include <bits/stdc++.h>   using namespace std;   pair<int, int> p[2005 * 2005];   char a[2005][2005], cg[4] = { v ,  < ,  ^ ,  > };   int n, m, mox[4] = {-1, 0, 1, 0}, moy[4] = {0, 1, 0, -1};   int ispoint(int x, int y) {     return (x >= 0 && x < n && y >= 0 && y < m && a[x][y] ==  . );   }   int deg(int x, int y) {     int ans = 0;     for (int i = 0; i < 4; i++) {       int fx = x + mox[i];       int fy = y + moy[i];       if (ispoint(fx, fy)) ans++;     }     return ans;   }   int main() {     while (scanf( %d %d , &n, &m) != EOF) {       for (int i = 0; i < n; i++) scanf( %s , a[i]);       int h = 0, sum = 0;       for (int i = 0; i < n; i++)         for (int j = 0; j < m; j++)           if (ispoint(i, j) && deg(i, j) == 1) p[sum++] = make_pair(i, j);       for (; h < sum; h++) {         int x = p[h].first, y = p[h].second;         for (int i = 0; i < 4; i++) {           int fx = x + mox[i];           int fy = y + moy[i];           if (ispoint(fx, fy)) {             a[x][y] = cg[i];             a[fx][fy] = cg[i ^ 2];             for (int i = 0; i < 4; i++) {               int ffx = fx + mox[i];               int ffy = fy + moy[i];               if (ispoint(ffx, ffy) && deg(ffx, ffy) == 1)                 p[sum++] = make_pair(ffx, ffy);             }             break;           }         }       }       int flag = 0;       for (int i = 0; i < n && !flag; i++)         for (int j = 0; j < m && !flag; j++)           if (a[i][j] ==  . ) flag = 1;       if (flag == 1)         printf( Not unique n );       else {         for (int i = 0; i < n; i++, printf(  n ))           for (int j = 0; j < m; j++) printf( %c , a[i][j]);       }     }     return 0;   }   