#include <bits/stdc++.h>
using namespace std;
long long n;
char ss[5005];
long long f[5005];
signed main() {
  scanf("%s", ss + 1);
  n = strlen(ss + 1);
  for (long long i = 0; i <= n; i++) f[i] = 1;
  long long k = log2(n), len = n - (1 << k) + 1;
  for (long long i = 1; i <= len; i++) {
    for (long long s = 0; s < (1 << k); s++)
      if (f[s])
        for (long long j = 0; j < k; j++) f[s | 1 << j] = 1;
    char ch = 'z';
    for (long long s = 0; s < (1 << k); s++)
      if (f[s]) ch = min(ch, ss[i + s]);
    cout << ch;
    for (long long s = 0; s < (1 << k); s++) f[s] &= (ch == ss[i + s]);
  }
  return puts(""), 0;
}
