#include <bits/stdc++.h>
using namespace std;
void stress();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  stress();
}
string naive(string s) {
  sort(s.begin(), s.end());
  return s;
}
string good(string s) {
  long long n = s.size();
  cout << 0 << " ";
  if (n == 1) return "";
  for (long long i = 1; i < n - 1; i++) {
    if (s[0] == 'a' && s[i] == 'b' && s[i + 1] == 'a') {
      cout << 1 << " ";
      reverse(s.begin(), s.begin() + i + 1);
    } else if (s[0] == 'b' && s[i] == 'a' && s[i + 1] == 'b') {
      cout << 1 << " ";
      reverse(s.begin(), s.begin() + i + 1);
    } else
      cout << 0 << " ";
  }
  string ans = s;
  reverse(s.begin(), s.end());
  if (ans < s) {
    s = ans;
    cout << 0;
  } else {
    cout << 1;
  }
  return s;
}
void stress() {
  string s;
  cin >> s;
  for (long long i = 0; i < 0; i++) {
    string s = "";
    for (long long j = 0; j < rand() % 10 + 1; j++) s += 'a' + rand() % 2;
    if (naive(s) != good(s)) {
      cout << s;
      break;
    }
    cout << s << " OK" << '\n';
    ;
  }
  good(s);
}
