#include <bits/stdc++.h>
const int _ = 5002;
int n, k, len;
bool dp[_];
char a[_];
inline int min(int a, int b) { return a < b ? a : b; }
int main() {
  scanf("%s", a + 1), n = strlen(a + 1), k = log2(n);
  memset(dp, 1, sizeof dp);
  for (int i = 1; i <= n - (1 << k) + 1; ++i) {
    char x = 'z';
    for (int s = 0; s < 1 << k; ++s)
      if (dp[s])
        for (int j = 0; j < k; ++j) dp[s | 1 << j] = 1;
    for (int s = 0; s < 1 << k; ++s)
      if (dp[s]) x = min(x, a[i + s]);
    for (int s = 0; s < 1 << k; ++s) dp[s] &= a[i + s] == x;
    putchar(x);
  }
  return 0;
}
