#include <bits/stdc++.h>
using namespace std;
using INT = long long;
const int NN = 5050;
int dp[NN][NN];
char s[NN];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  int tot = 1, cnt = 0;
  while (tot <= n) tot *= 2, cnt++;
  tot /= 2;
  tot--, cnt--;
  for (int i = 0; i <= tot; i++) dp[i][0] = 1;
  for (int ii = 1; ii <= n - tot; ii++) {
    int mn = 10010;
    for (int i = 0; i < n; i++)
      if (dp[i][ii - 1]) {
        mn = min(mn, (int)s[i + 1]);
      }
    putchar(mn);
    for (int i = ii - 1; i < n; i++)
      if (s[i + 1] == mn and dp[i][ii - 1]) {
        dp[i + 1][ii] = 1;
      }
    for (int i = ii; i <= n; i++)
      if (!dp[i][ii]) {
        int ss = i - ii;
        if (ss > tot) break;
        for (int j = 0; j <= cnt; j++)
          if ((ss >> j) & 1) {
            if (dp[i - (1 << j)][ii]) {
              dp[i][ii] = 1;
              break;
            }
          }
      }
  }
}
