#include <bits/stdc++.h>
using namespace std;
int _min(int x, int y) { return x < y ? x : y; }
int _max(int x, int y) { return x > y ? x : y; }
int read() {
  int s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * f;
}
bool f[5100][5100];
char ss[5100];
int main() {
  scanf("%s", ss + 1);
  int n = strlen(ss + 1);
  int u = log2(n);
  for (int i = 0; i < (1 << u); i++) f[0][i] = 1;
  for (int i = 1; i <= n - (1 << u) + 1; i++) {
    int minn = 26;
    for (int j = 0; j < (1 << u); j++) f[i][j] = f[i - 1][j];
    for (int j = 0; j < (1 << u); j++)
      if (f[i][j]) minn = _min(minn, ss[i + j] - 'a' + 1);
    for (int j = 0; j < (1 << u); j++)
      if (f[i][j] && minn != ss[i + j] - 'a' + 1) f[i][j] = 0;
    for (int j = 0; j < (1 << u); j++) {
      for (int k = 1; k <= u; k++)
        if ((j >> k - 1 & 1)) {
          f[i][j] |= f[i][j ^ (1 << k - 1)];
        }
    }
    printf("%c", minn + 'a' - 1);
  }
  return 0;
}
