func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     string s;     cin >> s;     vector<int> vec(1, 0);     vector<vector<int> > list;     int counter = 0, i, j;     for (i = 0; i < s.length(); i++) {       if (s[i] ==  0 ) {         if (list.size() > counter) {           list[counter].push_back(i);         } else {           vec[0] = i;           list.push_back(vec);         }         counter++;       } else if (s[i] ==  1 ) {         if (counter - 1 < 0) {           cout << -1;           return 0;         } else {           list[--counter].push_back(i);         }       }     }     if (counter < list.size()) {       cout << -1;       return 0;     }     cout << list.size() <<   n ;     for (i = 0; i < list.size(); i++) {       cout << list[i].size() <<    ;       for (j = 0; j < list[i].size(); j++) {         cout << list[i][j] + 1 <<    ;       }       cout <<   n ;     }     return 0;   }   