#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
const int N = 5005;
int n, rk[N][N], pre[N][N], K, a[N];
char s[N], t[N];
int top;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  K = log(n) / log(2.0);
  for (register int i = 0; i <= N - 1; i++) rk[0][i] = 1;
  for (register int i = 0; i <= (1 << K) - 1; i++) rk[0][i] = 0;
  for (register int i = 1; i <= n - (1 << K) + 1; i++) {
    for (register int j = 0; j <= (1 << K) - 1; j++) {
      rk[i][j] = rk[i - 1][j] * 26 + s[i + j] - 'a';
      pre[i][j] = 0;
      for (register int k = 1; k <= j; k <<= 1)
        if ((j & k) && rk[i][j ^ k] < rk[i][j]) {
          rk[i][j] = rk[i][j ^ k];
          pre[i][j] = k;
        }
    }
    int len = 0;
    for (register int j = 0; j <= (1 << K) - 1; j++) a[++len] = rk[i][j];
    sort(a + 1, a + len + 1);
    int tot = 1;
    for (register int j = 2; j <= len; j++)
      if (a[i] != a[i - 1]) a[++tot] = a[i];
    len = tot;
    for (register int j = 0; j <= (1 << K) - 1; j++)
      rk[i][j] = lower_bound(a + 1, a + len + 1, rk[i][j]) - a;
  }
  int x = n - (1 << K) + 1, y = (1 << K) - 1;
  while (x) {
    if (!pre[x][y]) {
      t[x] = s[x + y];
      x--;
      continue;
    }
    y -= pre[x][y];
  }
  for (register int i = 1; i <= n - (1 << K) + 1; i++) printf("%c", t[i]);
  return 0;
}
