#include <bits/stdc++.h>
using namespace std;
const long long MX = 2005;
const long long INF = 1e9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  vector<pair<long long, long long> > v;
  long long cnt0 = 0;
  long long cnt1 = 0;
  for (long long i = 0; i < (long long)s.size(); i++) {
    if (s[i] == '0') {
      if (cnt1 > 0) {
        v.push_back({cnt0, cnt1});
        cnt1 = cnt0 = 0;
      }
      cnt0++;
    } else {
      cnt1++;
    }
  }
  if (cnt0 > 0 || cnt1 > 0) {
    v.push_back({cnt0, cnt1});
  }
  multiset<long long> dif;
  long long a = 0;
  long long b = 0;
  for (long long i = 0; i + 1 < v.size(); i++) {
    a += v[i].second;
    b += v[i + 1].first;
    dif.insert(a - b);
  }
  long long acum = 0;
  for (long long i = 0; i < v.size(); i++) {
    long long maxMinus = v[i].second;
    if (i + 1 != v.size()) {
      maxMinus = min(maxMinus, (*dif.begin()) - acum);
      acum += v[i].second - v[i + 1].first;
      dif.erase(dif.find(acum));
    }
    if (maxMinus <= 0) {
      continue;
    }
    bool ok = true;
    if (i != 0) {
      long long a = v[i].first;
      long long b = v[i - 1].second;
      if (a < b) {
        ok = false;
      }
      for (long long j = i - 1; j >= 1; j--) {
        a += v[j].first;
        b += v[j - 1].second;
        if (a < b) {
          ok = false;
        }
      }
    }
    v[i].first += maxMinus;
    v[i].second -= maxMinus;
  }
  for (long long i = 0; i < (long long)v.size(); i++) {
    for (long long t = 0; t < (long long)v[i].first; t++) {
      cout << 0;
    }
    for (long long t = 0; t < (long long)v[i].second; t++) {
      cout << 1;
    }
  }
  return 0;
}
