#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int sum = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return f * sum;
}
const int N = 5305;
int n, f[N], S;
char s[N];
signed main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  S = log2(n);
  for (int i = 0; i <= n; i++) f[i] = 1;
  for (int i = 1, mx = n - (1 << S) + 1; i <= mx; i++) {
    char ch = 'z';
    for (int j = 0; j < (1 << S); j++)
      if (f[j])
        for (int k = 0; k < S; k++) f[j | (1 << k)] = 1;
    for (int j = 0; j < (1 << S); j++)
      if (f[j]) ch = min(ch, s[j + i]);
    for (int j = 0; j < (1 << S); j++) f[j] &= (s[j + i] == ch);
    putchar(ch);
  }
  puts("");
  return 0;
}
