#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0L);
const long double EPS = 1e-12L;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
namespace task {
const int INF = 1000000000;
const int N = 100001;
int n, z;
string s;
int d[N];
int c[N];
int a[N];
int b[N];
deque<int> v;
int main() {
  cin >> s;
  n = s.size();
  fill(d, d + N, INF);
  for (int i = 0; i < n; ++i) {
    a[i] = s[i] == '1';
  }
  d[0] = -INF;
  int t = 0;
  for (int i = 0; i < n; ++i) {
    int j = int(upper_bound(d, d + n + 1, a[i]) - d);
    if (d[j - 1] <= a[i] && a[i] <= d[j]) {
      d[j] = a[i];
      c[j] = c[j - 1] + 1;
      t = max(t, c[j]);
    }
    while (z + 1 > t) {
      b[v.back()] = 1;
      v.pop_back();
      --z;
    }
    if (a[i] == 1) {
      v.push_back(i);
    }
    ++z;
  }
  for (int i = 0; i < n; ++i) {
    cout << b[i];
  }
  cout << '\n';
  return 0;
}
}  // namespace task
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(11);
  cout.setf(ios::fixed);
  return task::main();
}
