#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> ans(n, 0);
  vector<long long> right(n, 0);
  long long last = -1;
  for (long long i = n - 1; i >= 0; i--) {
    if (i == n - 1 || s[i + 1] == 'b') last = i;
    right[i] = last;
  }
  for (long long i = 0; i < n; i++)
    if (s[i] == 'b' && s[i + 1] == 'a') {
      ans[i] = 1;
      ans[right[i + 1]] = 1;
    }
  for (long long i = 0; i < n; i++) cout << ans[i] << ' ';
  return 0;
}
