#include <bits/stdc++.h>
using namespace std;
char s[5010], c;
int f[5010], g[5010], n, m = 1, k;
int main() {
  scanf("%s", s + 1);
  for (n = strlen(s + 1); m <= n; k++) m <<= 1;
  m >>= 1;
  m--;
  k -= 2;
  n = n - m;
  for (register int i = 0; i <= m; i++) f[i] = 1;
  for (register int i = 1; i <= n; i++) {
    c = 'z';
    for (register int j = 0; j <= m; j++)
      if (f[j] && s[i + j] < c) c = s[i + j];
    putchar(c);
    for (register int i = 0; i <= m; i++) g[i] = 0;
    for (register int j = 0; j <= m; j++)
      if (f[j] && s[i + j] == c) g[j] = 1;
    for (register int j = 0; j <= m; j++)
      if (g[j])
        for (register int l = 0; l <= k; l++) g[j | (1 << l)] = 1;
    for (register int i = 0; i <= m; i++) f[i] = g[i];
  }
  return 0;
}
