#include <bits/stdc++.h>
using namespace std;
inline bool checkBit(long long n, long long i) {
  return n & ((long long)1 << i);
}
inline long long setBit(long long n, long long i) {
  return n | ((long long)1 << i);
  ;
}
inline long long resetBit(long long n, long long i) {
  return n & (~((long long)1 << i));
}
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline void normal(long long &a) { a = (a + 1000000007) % 1000000007; }
inline long long modMul(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  return (a * b) % 1000000007;
}
inline long long modAdd(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  return (a + b) % 1000000007;
}
inline long long modSub(long long a, long long b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline long long modPow(long long b, long long p) {
  long long r = 1;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1;
  }
  return r;
}
inline long long modInv(long long a) { return modPow(a, 1000000007 - 2); }
inline long long modDiv(long long a, long long b) {
  return modMul(a, modInv(b));
}
inline long long fact(long long r) {
  long long ans = 1;
  while (r) ans = modMul(ans, r), r--;
  return ans;
}
inline long long invfact(long long r) {
  long long ans = 1;
  while (r) ans = modMul(ans, modInv(r)), r--;
  return ans;
}
inline double dgcd(double a, double b) {
  if (a < b) return dgcd(b, a);
  if (b < .0001) return a;
  return dgcd(b, fmod(a, b));
}
const long long N = 1e5 + 1;
long long ones, zeros, a[N], len[N];
vector<long long> ans;
string s;
void solve() {
  cin >> s;
  for (long long i = 0; i < (long long)((s).size()); i++) {
    if (s[i] == '1') a[i] = 1;
  }
  for (long long i = 0; i < (long long)((s).size()); i++) {
    if (!a[i])
      zeros++;
    else
      ones = max(zeros, ones) + 1;
    len[i] = max(ones, zeros);
  }
  stack<long long> sc;
  ones = zeros = 0;
  for (long long i = 0; i < (long long)((s).size()); i++) {
    if (a[i]) {
      if (i < (long long)((s).size()) - 1 && !a[i + 1])
        ans.push_back(1), ones = max(ones + 1, zeros + 1);
      else {
        if (zeros + 1 > len[i])
          ans[sc.top()] = 1, i--, zeros--, sc.pop();
        else
          ans.push_back(0), zeros++, sc.push(i);
      }
    } else if (zeros + 1 > len[i])
      ans[sc.top()] = 1, zeros--, i--, sc.pop();
    else
      ans.push_back(0), zeros++;
  }
  for (auto it = (ans).begin(); it != (ans).end(); it++) cout << (*it);
  cout << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
}
