func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 2010;   vector<int> G[maxn];   int n, m, d[maxn], par[maxn], a[maxn], vis[maxn], flag = 1;   char s[1005][1005];   int find(int u) {     if (par[u] != u) par[u] = find(par[u]);     return par[u];   }   struct node {     int u, w;     node(int a, int b) { u = a, w = b; }   };   void topo() {     queue<node> q;     for (int i = 1; i <= n + m; i++) {       int fa = find(i);       if (!d[fa] && !vis[fa]) q.push(node(fa, 1)), vis[fa] = 1;     }     while (!q.empty()) {       node e = q.front();       q.pop();       int u = e.u;       a[u] = max(a[u], e.w);       for (int i = 0; i < G[u].size(); i++) {         int v = G[u][i];         a[v] = max(a[u] + 1, a[v]);         d[v]--;         if (d[v] == 0) q.push(node(v, a[v]));       }     }     for (int i = 1; i <= n + m; i++)       if (d[i]) puts( No ), exit(0);   }   void add(int i, int j) {     int fa = find(i), fb = find(j);     if (fa == fb) puts( No ), exit(0);     d[fa]++;     G[fb].push_back(fa);   }   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n + m; i++) par[i] = i;     for (int i = 1; i <= n; i++) {       scanf( %s , s[i] + 1);       for (int j = 1; j <= m; j++)         if (s[i][j] ==  = ) {           int fa = find(i), fb = find(j + n);           par[fa] = fb;         }     }     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         if (s[i][j] ==  > )           add(i, n + j);         else if (s[i][j] ==  < )           add(n + j, i);     topo();     puts( Yes );     for (int i = 1; i < n; i++) printf( %d  , a[find(i)]);     printf( %d n , a[find(n)]);     for (int i = 1; i < m; i++) printf( %d  , a[find(i + n)]);     printf( %d n , a[find(n + m)]);   }   