#include <bits/stdc++.h>
using namespace std;
string s;
set<int> st;
void go(int idx, int tp) {
  if (idx <= 0) return;
  if (tp == 0) {
    while (s[idx] == 'b') {
      idx--;
      if (idx <= 0) return;
    }
    if (idx == 0) return;
    st.insert(idx);
    go(idx - 1, 1);
  } else {
    while (s[idx] == 'a') {
      idx--;
      if (idx <= 0) return;
    }
    if (idx == 0) return;
    st.insert(idx);
    go(idx - 1, 0);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  go(((int)(s.size())) - 1, 0);
  for (int i = 0; i < ((int)(s.size())); i++) {
    if (st.count(i))
      cout << 1 << " ";
    else
      cout << 0 << " ";
  }
  return 0;
}
