#include <bits/stdc++.h>
using namespace std;
const int MM = 2e5 + 5, MOD = 1e9 + 7;
int N, o[MM], z[MM], pfx[2][MM], sfx[2][MM], lng;
string s, a;
int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  cin >> s;
  N = s.size();
  for (int i = 0; i < N; i++) {
    pfx[0][i] = pfx[0][i - 1] + (s[i] == '0' ? 1 : 0);
    pfx[1][i] = max(pfx[0][i - 1], pfx[1][i - 1]) + (s[i] == '1' ? 1 : 0);
    lng = max({lng, pfx[0][i], pfx[1][i]});
  }
  for (int i = N - 1; i >= 0; i--) {
    if (s[i] == '1') o[i]++;
    o[i] += o[i + 1];
    sfx[1][i] = sfx[1][i + 1] + (s[i] == '1' ? 1 : 0);
    sfx[0][i] = max(sfx[0][i + 1], sfx[1][i + 1]) + (s[i] == '0' ? 1 : 0);
    lng = max({lng, sfx[0][i], sfx[1][i]});
  }
  for (int i = 0, c = 0; i < N; i++, c = 0) {
    if (s[i] == '0') {
      a += '0', z[i] = z[i - 1] + 1;
      continue;
    }
    z[i] = z[i - 1];
    if (i > 0) c = max(pfx[1][i - 1], pfx[0][i - 1]) + o[i + 1];
    c = max(c, z[i - 1] + 1 + max(sfx[0][i + 1], sfx[1][i + 1]));
    if (c > lng)
      a += '1';
    else
      a += '0', z[i]++;
  }
  cout << a << "\n";
}
