#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
char S[N];
bool f[N][N];
int n, m, T, nxt[N][26];
void Deal_Late_No_More(int l, int r, int k) {
  if (l == r - 1) return;
  int mid = l + r >> 1;
  for (int i = l, j = mid; i < mid; i++, j++) f[k][j] |= f[k][i];
  Deal_Late_No_More(l, mid, k);
  Deal_Late_No_More(mid, r, k);
}
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  m = trunc(log(n) / log(2));
  T = 1 << m;
  for (int i = 1; i <= n; i++) S[i] -= 'a';
  for (int i = 0; i < 26; i++) nxt[n + 1][i] = 100000;
  for (int i = n; i; i--)
    for (int j = 0; j < 26; j++) nxt[i][j] = (j == S[i]) ? i : nxt[i + 1][j];
  f[0][0] = 1;
  Deal_Late_No_More(0, T, 0);
  for (int i = 1; i + T - 1 <= n; i++) {
    int c = 25;
    for (int j = 0; j < T; j++)
      if (S[i + j] < c && f[i - 1][j]) c = S[i + j];
    printf("%c", 'a' + c);
    for (int j = 0; j < T; j++)
      if (S[i + j] == c && f[i - 1][j]) f[i][j] = 1;
    Deal_Late_No_More(0, T, i);
  }
  return 0;
}
