#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using pii = pair<int, int>;
using vii = vector<pii>;
const int INF = INT_MAX;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
int n;
bool A[N];
string s;
bool ok(int len) {
  bool flag = 0;
  for (int i = 0, j = len - 1; i < j; i++, j--) {
    if (s[j] < s[i]) {
      flag = 1;
      break;
    }
  }
  return flag;
}
int main() {
  cin >> s;
  n = s.size();
  while (1) {
    int firstb = -1;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'b') {
        firstb = i;
        break;
      }
    }
    if (firstb == -1) {
      break;
    }
    if (firstb == 0) {
      int pos = firstb;
      while (pos < n and s[pos] == 'b') {
        pos++;
      }
      if (pos == n) {
        break;
      }
      while (pos < n and s[pos] == 'a') {
        pos++;
      }
      A[pos] = 1;
      reverse(s.begin(), s.begin() + pos);
    } else {
      int pos = firstb;
      while (pos < n and s[pos] == 'b') {
        pos++;
      }
      if (pos == n) {
        break;
      }
      A[pos] = 1;
      reverse(s.begin(), s.begin() + pos);
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << A[i] << " ";
  }
  cout << "\n";
  return 0;
}
