#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int n = s.size();
  int countf[n], count1 = 0, count0 = 0;
  countf[0] = s[0] - '0';
  if (s[0] == '1') {
    count1++;
  } else {
    count0++;
  }
  for (int i = 1; i < n; ++i) {
    if (s[i] == '1') {
      count1++;
    } else {
      count0++;
    }
    countf[i] = count1 - count0;
    if (countf[i] <= 0) {
      count1 = 0;
      count0 = 0;
      if (s[i] == '1') {
        count1++;
      }
      countf[i] = count1 - count0;
      if (s[i] == '0') {
        count0++;
      }
    }
  }
  for (int i = n - 1; i > 0; i--) {
    countf[i - 1] = min(countf[i], countf[i - 1]);
  }
  int changed = 0;
  for (int i = 0; i < n; i++) {
    if ((countf[i] - changed) > 0) {
      if (s[i] == '1') {
        s[i] = '0';
        changed++;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << s[i];
  }
  cout << endl;
  return 0;
}
