func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   string s, t;   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cin >> n >> t;     int ph = 0;     pair<int, int> mh = {0, 0};     for (int i = 0; i < n; i++) {       if (t[i] ==  ( )         ph++;       else         ph--;       mh = min(mh, make_pair(ph, i + 1));     }     if (ph != 0) {       cout <<  0 n1 1 n ;       return 0;     }     string s;     for (int i = mh.second; i < n; i++) {       s.push_back(t[i]);     }     for (int i = 0; i < mh.second; i++) {       s.push_back(t[i]);     }     int shift = mh.second;     int h = 0, cnt = 0, one = 0, two = 0, piv = 0, piv2 = -1;     pair<int, pair<int, int>> opt = {-1, {-1, -1}};     pair<int, pair<int, int>> opt2 = {-1, {-1, -1}};     for (int i = 0; i < n; i++) {       if (s[i] ==  ( )         h++;       else         h--;       if (h == 0) {         cnt++;         opt = max(opt, make_pair(one, make_pair(piv, i)));         one = 0;         piv = i + 1;         piv2 = -1;       } else if (h == 1) {         one++;         if (piv2 != -1) opt2 = max(opt2, make_pair(two, make_pair(piv2, i)));         two = 0;         piv2 = i + 1;       } else if (h == 2)         two++;     }     if (opt.first <= cnt + max(0, opt2.first)) {       if (opt2.first == -1) {         cout << cnt <<   n1 1 n ;         return 0;       }       cout << cnt + opt2.first <<   n ;       cout << (opt2.second.first + shift) % n + 1 <<    ;       cout << (opt2.second.second + shift) % n + 1 <<   n ;       return 0;     }     cout << opt.first <<   n           << (opt.second.first + shift) % n + 1 <<              << (opt.second.second + shift) % n + 1 <<   n ;     return 0;   }   