#include <bits/stdc++.h>
using namespace std;
inline void open(const char *s) {}
inline int rd() {
  static int x, f;
  x = 0;
  f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return f > 0 ? x : -x;
}
const int N = 5010;
int n;
bool f[N][N];
char s[N], ans[N];
int main() {
  open("hh");
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int m = -1;
  while ((1 << (m + 1)) <= n) ++m;
  int Max = (1 << m) - 1, nn = n - Max;
  memset(f[0], 1, sizeof f[0]);
  for (int i = 1; i <= nn; i++) {
    char mn = 'z' + 1;
    for (int j = 0; j <= Max; j++) f[i][j] = f[i - 1][j];
    for (int j = 0; j <= Max; j++)
      if (f[i][j]) mn = min(mn, s[i + j]);
    for (int j = 0; j <= Max; j++)
      if (mn != s[i + j]) f[i][j] = 0;
    for (int j = 0; j <= Max; j++)
      for (int k = 0; k <= m; k++)
        if (j >> k & 1) f[i][j] |= f[i][j ^ (1 << k)];
    ans[i] = mn;
  }
  printf("%s", ans + 1);
  return 0;
}
