#include <bits/stdc++.h>
using namespace std;
inline int Get() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, k;
char s[5005];
bool f[5005][(1 << 15) + 1];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  k = log2(n);
  for (int i = 0; i < 1 << k; i++) f[0][i] = 1;
  for (int i = 1; i <= n - (1 << k) + 1; i++) {
    char mn = 'z';
    memcpy(f[i], f[i - 1], sizeof(f[i]));
    for (int j = 0; j < 1 << k; j++)
      if (f[i][j]) mn = min(mn, s[i + j]);
    for (int j = 0; j < 1 << k; j++)
      if (s[i + j] != mn) f[i][j] = 0;
    for (int j = 0; j < 1 << k; j++) {
      for (int q = 0; q < k; q++) {
        if (j >> q & 1) f[i][j] |= f[i][j ^ (1 << q)];
      }
    }
    cout << mn;
  }
  return 0;
}
