#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char x = getchar();
  int f = 1, sum = 0;
  for (; (x < '0' || x > '9'); x = getchar())
    if (x == '-') f = -1;
  for (; x >= '0' && x <= '9'; x = getchar()) sum = sum * 10 + x - '0';
  return f * sum;
}
char s[5005];
int n, Max, all;
bool f[2][5005];
signed main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  Max = floor(log2(n));
  all = (1 << Max) - 1;
  int now = 0;
  for (register int i = 0; i <= all; ++i) f[0][i] = 1;
  for (register int i = 1; i <= n - all; ++i) {
    now ^= 1;
    memset(f[now], 0, sizeof(f[now]));
    int ans = 'z' + 2;
    for (register int j = 0; j <= all; ++j)
      if (f[now ^ 1][j]) ans = ((ans) < (s[i + j]) ? (ans) : (s[i + j]));
    putchar(ans);
    for (register int j = 0; j <= all; ++j) {
      if (!f[now ^ 1][j]) continue;
      if (s[i + j] > ans) continue;
      f[now][j] = 1;
      int bu = all ^ j;
      for (register int k = bu; k; k = (k - 1) & bu) f[now][j | k] = 1;
    }
  }
}
