#include <bits/stdc++.h>
using namespace std;
const int N = 5010;
int k, n, m;
int f[N], F[2][N];
char s[N];
bool b;
int main() {
  scanf("%s", s);
  n = m = strlen(s);
  f[0] = 1;
  while ((1 << k) <= n) k++;
  k--;
  m -= (1 << k) - 1;
  for (int i = 0; i < m; i++) {
    memcpy(F[b], f, sizeof(f));
    for (int j = 0; j < k; j++, b ^= 1) {
      memcpy(F[b ^ 1], F[b], sizeof(f));
      for (int p = 0; p < (1 << k); p++) F[b ^ 1][p | (1 << j)] |= F[b][p];
    }
    memcpy(f, F[b], sizeof(f));
    char Ans = 'z';
    for (int j = 0; j < (1 << k); j++) {
      int pos = i + j;
      if (!f[j] || pos >= n) continue;
      Ans = min(Ans, s[pos]);
    }
    putchar(Ans);
    for (int j = 0; j < (1 << k); j++) {
      int pos = i + j;
      if (!f[j] || pos >= n || s[pos] != Ans) f[j] = 0;
    }
  }
}
