#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const U &b) {
  if (a < b) a = b;
}
using DO = double;
using LL = long long;
using VI = vector<int>;
using pii = pair<int, int>;
const int N = 1e5 + 10;
char s[N];
pii p[N];
int flag[N];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  int m = n;
  for (int i = 0; i < n; i++) p[i] = {s[i] - '0', i};
  while (true) {
    int M = m;
    m = 0;
    for (int i = 0; i < M; i++) {
      if (m && p[m - 1].first > p[i].first)
        m--;
      else
        p[m++] = p[i];
    }
    if (M == m) break;
  }
  for (int i = 0; i < m; i++)
    if (p[i].first) s[p[i].second] = '0';
  printf("%s\n", s);
  return 0;
}
