#include <bits/stdc++.h>
using namespace std;
long long n, memo[200010][2], maxi[200010];
string s, r;
void solve() {
  cin >> s;
  r = s;
  n = s.size();
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0') {
      if (i == 0) {
        memo[i][0] = 1;
      } else {
        memo[i][0] = memo[i - 1][0] + 1;
        memo[i][1] = memo[i - 1][1];
      }
    } else {
      if (i == 0) {
        memo[i][1] = 1;
      } else {
        memo[i][1] = max(memo[i - 1][1] + 1, memo[i - 1][0] + 1);
        memo[i][0] = memo[i - 1][0];
      }
    }
    maxi[i] = max(0ll, memo[i][1] - memo[i][0]);
  }
  for (long long i = n - 2; i >= 0; i--) maxi[i] = min(maxi[i], maxi[i + 1]);
  long long cur = 0;
  for (long long i = 0; i < n; i++) {
    if (i == n - 1 and s[i] == '1' and cur < maxi[i]) {
      r[i] = '0';
      continue;
    }
    if (s[i] == '1' and s[i + 1] == '1' and cur < maxi[i]) {
      cur++;
      r[i] = '0';
    }
  }
  cout << r << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
