func_code_string: #include <bits/stdc++.h>   using namespace std;   int mod = 1e9 + 7;   const int N = 1005;   vector<pair<int, int>> graph[N];   vector<int> ans;   int vis[N];   int v[N];   void dfs(int pos) {     vis[pos] = 1;     v[pos] = 1;     for (auto& e : graph[pos]) {       if (vis[e.first] == 0) {         if (e.second == 0) {           int c = max(ans[e.first], ans[pos]);           ans[e.first] = c;           ans[pos] = c;         } else {           if (ans[e.first] <= ans[pos]) {             ans[e.first] = ans[pos] + 1;           }         }         dfs(e.first);       }     }     vis[pos] = 0;   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int t = 1;     while (t--) {       int n;       cin >> n;       string str;       cin >> str;       int cnt = 1;       for (int i = 0; i < n; i++) {         ans.push_back(1);       }       for (int i = 0; i < str.length(); i++) {         if (str[i] ==  = ) {           graph[cnt].push_back({cnt - 1, 0});           graph[cnt - 1].push_back({cnt, 0});         } else if (str[i] ==  L ) {           graph[cnt].push_back({cnt - 1, 1});         } else {           graph[cnt - 1].push_back({cnt, 1});         }         cnt++;       }       for (int i = 0; i < n; i++) {         if (v[i] == 0) {           dfs(i);         }       }       for (auto& e : ans) {         cout << e <<    ;       }       cout << endl;     }     return 0;   }   