#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, i, j, x;
  string s;
  cin >> s;
  n = s.size();
  long long dpp[n], dps[n], zero[n], one[n];
  dps[n - 1] = 1;
  if (s[n - 1] == '1')
    one[n - 1] = 1;
  else
    one[n - 1] = 0;
  for (i = n - 2; i >= 0; i--) {
    if (s[i] == '1') {
      one[i] = one[i + 1] + 1;
      dps[i] = max(one[i], dps[i + 1]);
    } else {
      one[i] = one[i + 1];
      dps[i] = dps[i + 1] + 1;
    }
  }
  for (i = 0; i < n; i++) {
    if (s[i] == '1') {
      long long t1 = 0, t2 = 1, t;
      if ((i + 1) < n) t1 += one[i + 1], t2 += dps[i + 1];
      if ((i - 1) >= 0) t1 += dpp[i - 1], t2 += zero[i - 1];
      t = max(t1, t2);
      if (t == dps[0]) {
        s[i] = '0';
        if (i == 0) {
          zero[i] = 1;
          dpp[i] = 1;
        } else {
          zero[i] = zero[i - 1] + 1;
          dpp[i] = max(zero[i], dpp[i - 1]);
        }
      } else {
        if (i == 0) {
          zero[i] = 0;
          dpp[i] = 1;
        } else {
          zero[i] = zero[i - 1];
          dpp[i] = dpp[i - 1] + 1;
        }
      }
    } else {
      if (i == 0) {
        zero[i] = 1;
        dpp[i] = 1;
      } else {
        zero[i] = zero[i - 1] + 1;
        dpp[i] = max(zero[i], dpp[i - 1]);
      }
    }
  }
  cout << s;
}
