#include <bits/stdc++.h>
using namespace std;
int n, m, bit, dp[5050][5050], fr[5050][5050];
char s[5050], ans[5050];
pair<int, int> p[5050];
int main() {
  scanf("%s", s);
  n = strlen(s);
  fill(&fr[0][0], &fr[5049][5050], -1);
  int m = n;
  for (int i = 1;; i++) {
    if (1 << i <= n)
      bit = i, m -= 1 << i - 1;
    else
      break;
  }
  for (int i = 0; i < 1 << bit; i++) fr[0][i] = 0;
  for (int i = 1; i <= m; i++) {
    int cnt = 0;
    for (int j = 0; j < 1 << bit; j++)
      if (~fr[i - 1][j]) {
        p[cnt++] = {dp[i - 1][j] * 26 + s[j + i - 1], j};
      }
    sort(p, p + cnt);
    int t = 0;
    for (int j = 0; j < cnt; j++) {
      if (j && p[j - 1].first != p[j].first) t++;
      dp[i][p[j].second] = t;
      fr[i][p[j].second] = (i - 1) * n + p[j].second;
    }
    for (int j = 0; j < 1 << bit; j++) {
      for (int k = 1; k <= j; k *= 2)
        if ((k & j) && ~fr[i][j ^ k] &&
            (!~fr[i][j] || dp[i][j] > dp[i][j ^ k])) {
          dp[i][j] = dp[i][j ^ k];
          fr[i][j] = i * n + (j ^ k);
        }
    }
  }
  int x = m, y = (1 << bit) - 1;
  while (x) {
    int tx = fr[x][y] / n, ty = fr[x][y] % n;
    if (tx != x) {
      ans[x - 1] = s[x + y - 1];
    }
    x = tx;
    y = ty;
  }
  puts(ans);
  return 0;
}
