#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return res;
}
long long inv(long long x) { return power(x, mod - 2); }
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int dist[111][111];
int g[111][111];
int jud[1111111];
int n;
void bfs(int x) {
  queue<int> q;
  int visited[111] = {0};
  q.push(x);
  dist[x][x] = 0;
  visited[x] = 1;
  while (!q.empty()) {
    int temp = q.front();
    for (int i = 1; i <= n; i++) {
      if (g[temp][i]) {
        if (!visited[i]) {
          visited[i] = 1;
          dist[x][i] = dist[x][temp] + 1;
          q.push(i);
        }
      }
    }
    q.pop();
  }
}
char a[1111111];
char b[1111111];
int main() {
  int cnt0 = 0, cnt1 = 0, m1 = 0, m2 = 0, i;
  cin >> a;
  int n = strlen(a);
  for (i = n - 1; i >= 0; i--) {
    if (a[i] == '0') {
      cnt0++;
    } else {
      cnt1++;
    }
    if (cnt0 >= cnt1) {
      b[i] = a[i];
    } else {
      for (; i >= 0 && a[i] == '1'; i--) b[i] = '0';
      cnt0 = cnt1 = 0;
      i++;
    }
  }
  b[n] = '\0';
  for (i = 0; i < n; i++) cout << b[i];
}
