#include <bits/stdc++.h>
using namespace std;
const long long N = 5005;
long long n, m, dp[N];
char s[N];
inline long long read() {
  long long ret = 0, f = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    ret = ret * 10 + c - 48;
    c = getchar();
  }
  if (f) return -ret;
  return ret;
}
long long lowbit(long long x) { return x & -x; }
signed main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  m = log2(n);
  for (long long i = 0; i < (1 << m); i++) dp[i] = 1;
  for (long long i = 1; i <= n - (1 << m) + 1; i++) {
    char mi = 'z';
    for (long long j = 0; j < (1 << m); j++)
      if (dp[j]) mi = min(mi, s[i + j]);
    for (long long j = 0; j < (1 << m); j++) dp[j] &= (s[i + j] == mi);
    for (long long j = 0; j < (1 << m); j++)
      if (dp[j])
        for (long long k = 0; k < m; k++) dp[j | (1 << k)] = 1;
    putchar(mi);
  }
  return 0;
}
