#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
const int N = 1e6 + 5;
int T, n;
char s[N], t[N];
int a[N][2], b[N][2];
int main() {
  std::ios::sync_with_stdio(0);
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = n; i >= 1; i--) {
    if (s[i] == '1') {
      a[i][1] = a[i + 1][1] + 1;
      a[i][0] = max(a[i + 1][0], a[i][1]);
    } else {
      a[i][0] = a[i + 1][0] + 1;
      a[i][1] = a[i + 1][1];
    }
    b[i][0] = a[i][0];
    b[i][1] = a[i][1];
  }
  for (int i = n; i >= 1; i--) {
    if (s[i] == '1') {
      int t1 = b[i][0];
      int t2 = b[i][1];
      b[i][0] = b[i + 1][0] + 1;
      b[i][1] = b[i + 1][1];
      int x = max(b[i][0], b[i][1]);
      int y = max(a[i][0], a[i][1]);
      if (x == y) {
        t[i] = '0';
      } else {
        t[i] = '1';
        b[i][0] = t1;
        b[i][1] = t2;
      }
    } else
      t[i] = '0';
  }
  t[n + 1] = '\0';
  printf("%s\n", t + 1);
}
