#include <bits/stdc++.h>
using namespace std;
char s[5005];
int limit, tot;
bool dp[5005];
int main() {
  memset(dp, true, sizeof(dp));
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  limit = 1;
  while (limit * 2 <= n) limit *= 2, tot++;
  for (int i = 1; i <= n - limit + 1; i++) {
    char ch = 'z';
    for (int j = 0; j < limit; j++)
      if (dp[j]) ch = min(ch, s[i + j]);
    putchar(ch);
    for (int j = 0; j < limit; j++) dp[j] = dp[j] & (s[i + j] == ch);
    for (int j = 0; j < limit; j++)
      for (int k = 0; k < tot; k++) dp[j | (1 << k)] |= dp[j];
  }
  return 0;
}
