#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = s.length();
  long long count_zero = 0, count_one = 0;
  stack<char> ans;
  for (long long i = n - 1; i >= 0;) {
    if (s[i] == '0') {
      long long c1 = 1;
      long long j = i - 1;
      while (j >= 0 && s[j] == '0') c1++, j--;
      i = j;
      for (j = 1; j <= c1; j++) ans.push('0');
      count_zero += c1;
    } else {
      count_one = 1;
      long long j = i - 1;
      while (j >= 0 && s[j] == '1') count_one++, j--;
      i = j;
      long long one = min(count_one, count_zero);
      long long zero = count_one - one;
      for (j = 1; j <= one; j++) ans.push('1');
      for (j = 1; j <= zero; j++) ans.push('0');
      long long w = 0;
      count_zero = max(w, count_zero - one);
    }
  }
  while (!ans.empty()) {
    char ch = ans.top();
    ans.pop();
    cout << ch;
  }
  return 0;
}
