#include <bits/stdc++.h>
using namespace std;
int n, t[200010 * 4], laz[200010 * 4];
char s[200010];
int a[200010], b[200010];
void Build(int k, int l, int r) {
  if (l == r) {
    t[k] = a[l] + b[l];
    return;
  }
  Build(k * 2, l, (l + r) / 2);
  Build(k * 2 + 1, (l + r) / 2 + 1, r);
  t[k] = max(t[k * 2], t[k * 2 + 1]);
}
void Up(int k, int l, int r) {
  t[k * 2] += laz[k];
  t[k * 2 + 1] += laz[k];
  laz[k * 2] += laz[k];
  laz[k * 2 + 1] += laz[k];
  laz[k] = 0;
}
void Insert(int k, int l, int r, int x, int y, int z) {
  if (x <= l && y >= r) {
    t[k] += z;
    laz[k] += z;
    return;
  }
  if (laz[k]) Up(k, l, r);
  if (x <= (l + r) / 2) Insert(k * 2, l, (l + r) / 2, x, y, z);
  if (y > (l + r) / 2) Insert(k * 2 + 1, (l + r) / 2 + 1, r, x, y, z);
  t[k] = max(t[k * 2], t[k * 2 + 1]);
}
int ss(char s[200010]) {
  for (int i = 1; i <= n; i++)
    if (s[i] == '0')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1];
  for (int i = n; i >= 1; i--)
    if (s[i] == '1')
      b[i] = b[i + 1] + 1;
    else
      b[i] = b[i + 1];
  int mx = 0;
  for (int i = 1; i <= n; i++) mx = max(mx, a[i] + b[i]);
  return mx;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int len = ss(s);
  Build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '0') continue;
    s[i] = '0';
    Insert(1, 1, n, 1, i, -1);
    Insert(1, 1, n, i, n, 1);
    if (t[1] != len) {
      s[i] = '1';
      Insert(1, 1, n, 1, i, 1);
      Insert(1, 1, n, i, n, -1);
    }
  }
  for (int i = 1; i <= n; i++) printf("%c", s[i]);
  printf("\n");
  return 0;
}
