#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
using namespace std;
template <class T, class U>
inline void checkmin(T &x, U y) {
  if (y < x) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
  if (y > x) x = y;
}
template <class T, class U>
inline bool ifmax(T &x, U y) {
  if (y > x) return x = y, true;
  return false;
}
template <class T, class U>
inline bool ifmin(T &x, U y) {
  if (y < x) return x = y, true;
  return false;
}
template <class T>
inline void sort(T &a) {
  sort(a.begin(), a.end());
}
template <class T>
inline void rsort(T &a) {
  sort(a.rbegin(), a.rend());
}
template <class T>
inline void reverse(T &a) {
  reverse(a.begin(), a.end());
}
template <class T, class U>
inline istream &operator>>(istream &str, pair<T, U> &p) {
  return str >> p.first >> p.second;
}
template <class T>
inline istream &operator>>(istream &str, vector<T> &a) {
  for (auto &i : a) str >> i;
  return str;
}
struct node {
  int pref = 0, suff = 0, ans = 0;
  node() {}
  node(int a) {
    if (a == 0) {
      ans = pref = 1;
      suff = 0;
    } else {
      ans = suff = 1;
      pref = 0;
    }
  }
};
node merge(node a, node b) {
  node ans;
  ans.pref = a.pref + b.pref;
  ans.suff = a.suff + b.suff;
  ans.ans = max(a.ans + b.suff, a.pref + b.ans);
  return ans;
}
struct Tree {
  static const int n = 1 << 17;
  node t[2 * n + 5];
  void upd(int r, int x) {
    r += n;
    t[r] = node(x);
    for (r >>= 1; r > 0; r >>= 1) t[r] = merge(t[r + r], t[r + r + 1]);
  }
  int get() { return t[1].ans; }
} t;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(12);
  srand(94385);
  string second;
  cin >> second;
  for (int i = 0; i < signed(second.size()); ++i) t.upd(i, second[i] - '0');
  for (int i = 0; i < signed(second.size()); ++i) {
    if (second[i] == '1' &&
        (i == signed(second.size()) - 1 || second[i + 1] == '1') &&
        (i == 0 || second[i - 1] == '0')) {
      int was = t.get();
      second[i] = '0';
      t.upd(i, second[i] - '0');
      int now = t.get();
      if (was == now) continue;
      second[i] = '1';
      t.upd(i, second[i] - '0');
    }
  }
  cout << second;
  return 0;
}
