func_code_string: #include <bits/stdc++.h>   using namespace std;   template <class T>   T gcd(T a, T b) {     return b ? gcd(b, a % b) : a;   }   const int maxn = 1000100;   char s[maxn];   vector<int> a[maxn];   void solve() {     cin >> s;     int n = strlen(s);     int c = 0;     for (int i = 0; i < n; i++) {       c += s[i] ==  0  ? 1 : -1;       if (c < 0) {         puts( -1 );         return;       }     }     c = 0;     for (int i = n - 1; i >= 0; i--) {       c += s[i] ==  0  ? 1 : -1;       if (c < 0) {         puts( -1 );         return;       }     }     int nol = 0, bir = 0;     for (int i = 0; i < n; i++) {       if (s[i] ==  0 ) {         if (bir) {           a[bir - 1].push_back(i + 1);           bir--;         } else {           nol++;           a[nol - 1].push_back(i + 1);         }       } else {         a[bir].push_back(i + 1);         bir++;       }     }     cout << nol << endl;     for (int i = 0; i < nol; i++) {       printf( %d , a[i].size());       for (int j = 0; j < a[i].size(); j++) printf(  %d , a[i][j]);       cout << endl;     }   }   int main() {     int t = 1;     while (t--) {       solve();     }   }   