#include <bits/stdc++.h>
using namespace std;
char s[5000 + 5];
bool dp[5000 + 5];
int lg(int n) { return n == 1 ? 0 : 1 + lg(n / 2); }
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1), k = lg(n);
  dp[0] = 1;
  for (int i = 1; i <= n - (1 << k) + 1; i++) {
    for (int msk = 0; msk <= (1 << k) - 1; msk++)
      if (dp[msk])
        for (int b = 0; b <= k - 1; b++) dp[msk | (1 << b)] = 1;
    char c = 'z';
    for (int msk = 0; msk <= (1 << k) - 1; msk++)
      if (dp[msk]) c = min(c, s[i + msk]);
    for (int msk = 0; msk <= (1 << k) - 1; msk++)
      if (s[i + msk] != c) dp[msk] = 0;
    putchar(c);
  }
  puts("");
  return 0;
}
