#include <bits/stdc++.h>
using namespace std;
char s[100100];
int mx[100100];
bool ok[100100];
int ls[5];
int pre[1001000];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  ls[0] = ls[1] = n + 1;
  for (int i = 0; i < n; i++) {
    if (i) pre[i] = pre[i - 1];
    if (s[i] == '0')
      pre[i]--;
    else
      pre[i]++;
    ok[i] = 1;
  }
  int mn = 1e9;
  for (int i = n - 1; i >= 0; i--) {
    if (mn - pre[i] < 0) {
      ok[i] = 0;
    }
    mn = min(mn, pre[i]);
  }
  for (int i = 0; i < n; i++) {
    mx[i] = 1;
    if (ls[0] != -1) {
      mx[i] = max(mx[i], mx[ls[0]] + 1);
    }
    if (ls[1] != -1 && s[i] != '0') {
      mx[i] = max(mx[i], mx[ls[1]] + 1);
    }
    if (s[i] == '1') {
      if (ok[i] && mx[ls[0]] + 1 == mx[i]) {
        s[i] = '0';
        ls[0] = i;
      } else {
        ls[1] = i;
      }
    } else {
      ls[0] = i;
    }
  }
  ls[0] = ls[1] = n + 1;
  for (int i = n - 1; i >= 0; i--) {
    mx[i] = 1;
    if (ls[0] != -1 && s[i] != '1') {
      mx[i] = max(mx[i], mx[ls[0]] + 1);
    }
    if (ls[1] != -1) {
      mx[i] = max(mx[i], mx[ls[1]] + 1);
    }
    if (s[i] == '1') {
      ls[1] = i;
      if (1) {
        if (ok[i]) s[i] = '0';
      }
    } else {
      ls[0] = i;
    }
  }
  printf("%s", s);
  return 0;
}
