#include <bits/stdc++.h>
using namespace std;
template <typename... Args>
void logger(string vars, Args &&...values) {
  cout << vars << " = ";
  string delim = "";
}
inline string toString(long long x) {
  string ans = "";
  bool negtive = x < 0;
  x = abs(x);
  while (x) ans.push_back(x % 10 + '0'), x /= 10;
  if (ans.size() == 0) ans = "0";
  if (negtive) ans.push_back('-');
  for (long long i = 0; i < ans.size() / 2; i++)
    swap(ans[i], ans[ans.size() - 1 - i]);
  return ans;
}
inline long long toInt(const string &str) {
  long long ans = 0;
  bool negtive = str[0] == '-';
  for (long long i = negtive; i < str.size(); i++)
    ans = ans * 10 + str[i] - '0';
  if (negtive) ans *= -1;
  return ans;
}
inline long long gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d = a;
  if (b == 0)
    x = 1, y = 0;
  else {
    d = exgcd(b, a % b, y, x), y -= a / b * x;
  }
  return d;
}
const long long mod = 1000000007;
inline long long rd() {
  long long ans = 0;
  char last = ' ', ch = getchar();
  while (!(ch >= '0' && ch <= '9')) last = ch, ch = getchar();
  while (ch >= '0' && ch <= '9')
    ans = (ans << 3) + (ans << 1) + ch - '0', ch = getchar();
  return ans;
}
inline long long QPow(long long a, long long b) {
  long long ans = 1;
  if (b < 0) return 0;
  while (b) {
    if (b & 1) ans = ans * a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
inline long long QPow(long long a, long long b, const long long &mod) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
const double PI = 3.141592653589793115997963468544185161590576171875;
const double e = 2.718281828459045;
void ask(long long x) {
  cout << "? " << x << endl;
  cout.flush();
  ;
}
void decide(long long x) {
  cout << "! " << x << endl;
  cout.flush();
  ;
}
short _min(short a, short b) { return a < b ? a : b; }
const long long inf = 1000000000;
const long long inf2 = 10000;
const double eps = 5e-9;
const long long maxn = 2005;
bool vis[maxn];
long long dp[maxn][maxn];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, n;
  string str;
  cin >> str;
  n = str.size();
  str = " " + str;
  string ans = str;
  for (long long i = 1; i <= n; i++) {
    long long sum = 0;
    for (long long j = i; j <= n; j++) {
      sum += str[j] != '0';
      if (i == j) {
        dp[i][j] = 1;
      } else {
        if (str[j] == '1')
          dp[i][j] = 1 + dp[i][j - 1];
        else {
          dp[i][j] = max(dp[i][j - 1], j - i + 1 - sum);
        }
      }
    }
  }
  for (long long i = n; i >= 1; i--) {
    bool flag = 1;
    for (long long j = i; j <= n; j++) {
      flag &= dp[i][j] == (1 + dp[i + 1][j]);
    }
    if (flag)
      ans[i] = '0';
    else
      ans[i] = '1';
  }
  for (long long i = 1; i <= n; i++) cout << ans[i];
  return 0;
}
