#include <bits/stdc++.h>
using namespace std;
int cnt;
char str[5055], ans[5055];
int vis[5055], times;
int main() {
  int n, k, i, j, s, p, q;
  scanf("%s", str);
  n = strlen(str);
  k = (int)log2(1. * n);
  times++;
  vis[0] = times;
  for (i = 0; i < (n - (1 << k) + 1); i++) {
    ans[i] = 'z' + 1;
    for (j = 0; j < (1 << k); j++) {
      if (vis[j] == times) {
        for (s = 0; s < k; s++) {
          if (j & (1 << s)) {
            if (vis[j ^ (1 << s)] == times) break;
          }
        }
        if (s >= k) {
          int nj = (1 << k) - 1 - j;
          for (s = nj;; s = (s - 1) & nj) {
            if (str[i + (s | j)] < ans[i]) ans[i] = str[i + (s | j)];
            if (s == 0) break;
          }
        }
      }
    }
    for (j = 0; j < (1 << k); j++) {
      if (vis[j] == times) {
        for (s = 0; s < k; s++) {
          if (j & (1 << s)) {
            if (vis[j ^ (1 << s)] == times) break;
          }
        }
        if (s >= k) {
          int nj = (1 << k) - 1 - j;
          for (s = nj;; s = (s - 1) & nj) {
            if (str[i + (s | j)] == ans[i]) vis[s | j] = times + 1;
            if (s == 0) break;
          }
        }
      }
    }
    times++;
  }
  for (i = 0; i < n - (1 << k) + 1; i++) putchar(ans[i]);
  printf("\n");
}
