#include <bits/stdc++.h>
using namespace std;
long long n, pr[100005], sf[100005], h[100005];
string s;
void Solve() {
  cin >> s;
  n = s.size();
  s = "2" + s + "1";
  for (long long i = 1, _b = n; i <= _b; i++) pr[i] = (s[i] == '1') + pr[i - 1];
  for (long long i = n, _b = 1; i >= _b; i--) sf[i] = (s[i] == '1') + sf[i + 1];
  long long ma = 0;
  for (long long i = n, _b = 1; i >= _b; i--) ma = max(ma, sf[i] + (i - pr[i]));
  h[n + 1] = 1e18;
  for (long long i = n, _b = 1; i >= _b; i--) {
    h[i] = ma - (sf[i + 1] + (i - pr[i]));
    h[i] = min(h[i], h[i + 1]);
  }
  long long dem = 0;
  for (long long i = 1, _b = n; i <= _b; i++)
    if (s[i + 1] == '1' && dem < h[i]) dem++, s[i] = '0';
  for (long long i = 1, _b = n; i <= _b; i++) cout << s[i];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int Test_numbers = 1;
  while (Test_numbers--) Solve();
  return 0;
}
