#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  string s;
  cin >> s;
  n = s.size();
  vector<int> v(n);
  for (int i = 0; i < n; i++) v[i] = (s[i] == '0') ? 0 : 1;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    if (i < 0) continue;
    cout << i << " ";
    if (v[i] + v[i + 1] == 1) {
      n -= 2;
      for (int j = i; j < n; j++) {
        v[j] = v[j + 2];
      }
      ans++;
      i -= 2;
    }
  }
  cout << endl;
  cout << ans * 2 << endl;
}
