func_code_string: #include <bits/stdc++.h>   using namespace std;   string s;   int n;   signed main() {     ios_base ::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> s;     vector<pair<int, int>> a;     vector<int> p(n, 0), nxt(n, 0);     stack<pair<int, int>> S;     S.push({0, -1});     for (int i = 0; i < n; ++i) {       if (s[i] ==  ( ) {         p[i] = S.top().second;         a.push_back({S.top().first + 1, i});         S.push({a.back().first, i});       } else {         nxt[S.top().second] = i;         S.pop();       }     }     sort(a.rbegin(), a.rend());     string k(n,  x );     for (int i = 0; i < int(a.size()); ++i) {       int y = a[i].second;       if (k[y] !=  x ) {         k[nxt[y]] = k[y];         continue;       }       int c = -1, cnt = 0;       for (y = a[i].second; y != -1 && k[y] ==  x ; y = p[y]) cnt ^= 1;       if (y != -1) c = k[y] -  0 ;       int t = 1;       if (c != -1) t = c ^ cnt;       for (y = a[i].second; y != -1 && k[y] ==  x ; t ^= 1, y = p[y])         k[y] = t +  0 ;       k[nxt[a[i].second]] = k[a[i].second];     }     cout << k <<   n ;     return 0;   }   