#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 100;
int n, k;
char str[N];
bool f[N];
int main() {
  scanf("%s", str + 1), n = strlen(str + 1);
  while (1 << k < n) ++k;
  if (1 << k > n) --k;
  memset(f, 1, sizeof(f));
  for (int i = 1; i <= n - (1 << k) + 1; ++i) {
    char ch = 'z';
    for (int s = 0; s < 1 << k; ++s)
      if (f[s])
        for (int t = 0; t < k; ++t) f[s | (1 << t)] = 1;
    for (int s = 0; s < 1 << k; ++s)
      if (f[s]) ch = min(str[i + s], ch);
    for (int s = 0; s < 1 << k; ++s)
      if (str[i + s] != ch) f[s] = 0;
    putchar(ch);
  }
  return 0;
}
