#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vll = vector<long long>;
using vpi = vector<pair<int, int>>;
using pii = pair<int, int>;
const char nl = '\n';
const ll MOD = 1e9 + 7;
string to_string(char c) { return string(1, c); }
string to_string(const char* s) { return (string)s; }
string to_string(string s) { return s; }
string to_string(bool b) { return to_string((int)b); }
template <class A>
string to_string(complex<A> c) {
  stringstream ss;
  ss << c;
  return ss.str();
}
string to_string(vector<bool> v) {
  string res = "{";
  for (int i = 0; i < ((int)v.size()); ++i) res += char('0' + v[i]);
  res += "}";
  return res;
}
template <size_t SZ>
string to_string(bitset<SZ> b) {
  string res = "";
  for (int i = 0; i < (SZ); ++i) res += char('0' + b[i]);
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p);
template <class T>
string to_string(T v) {
  bool fst = 1;
  string res = "";
  for (const auto& x : v) {
    if (!fst) res += " ";
    fst = 0;
    res += to_string(x);
  }
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p) {
  return to_string(p.f) + " " + to_string(p.s);
}
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  const int n = (int)s.size();
  string t;
  set<int> ps;
  int last1 = -1;
  for (int i = 0; i < (n - 1); ++i) {
    if (s[i] == '1' && s[i + 1] == '0') {
      t += '1';
    } else {
      t += '0';
      if (s[i] == '1') ps.insert(i);
    }
  }
  t += '0';
  array<int, 2> dp_s{}, dp_t{};
  auto next = [&](char cur, array<int, 2>& dp) {
    auto old = dp;
    if (cur == '0') {
      dp[0] = old[0] + 1;
      dp[1] = old[1];
    } else {
      dp[0] = old[0];
      dp[1] = 1 + max(old[0], old[1]);
    }
  };
  for (int i = 0; i < (n); ++i) {
    next(s[i], dp_s);
    next(t[i], dp_t);
    int ms = max(dp_s[0], dp_s[1]);
    int mt = max(dp_t[0], dp_t[1]);
    if (mt > ms) {
      0;
      auto it = prev(ps.lower_bound(i));
      t[*it] = '1';
      ps.erase(it);
      dp_t[0]--;
    }
  }
  cout << t << nl;
  return 0;
}
