#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double eps = 1e-10;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3fll;
const int MAXN = 5e3 + 5;
char s[MAXN];
int d[MAXN];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  int l = log2(n + eps);
  int m = n - (1 << l) + 1;
  for (int i = 0; i < (1 << l); i++) d[i] = 1;
  for (int i = 1; i <= m; i++) {
    char c = 'z';
    for (int j = 0; j < (1 << l); j++) {
      if (d[j]) {
        for (int k = 0; k < l; k++) d[j | (1 << k)] = 1;
      }
    }
    for (int j = 0; j < (1 << l); j++)
      if (d[j]) c = min(c, s[i + j]);
    for (int j = 0; j < (1 << l); j++) d[j] &= (s[i + j] == c);
    putchar(c);
  }
  return 0;
}
