#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
char s[N];
int dp[N];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1), k = log2(n);
  dp[0] = 1;
  for (int i = 1; i <= n - (1 << k) + 1; i++) {
    for (int j = 0; j < k; j++)
      for (int l = 0; l < 1 << k; l++)
        if ((1 << j) & l) dp[l] |= dp[l ^ (1 << j)];
    int Min = 1e9;
    for (int j = 0; j < 1 << k; j++)
      if (dp[j]) Min = min(Min, (int)s[i + j]);
    putchar(Min);
    for (int j = 0; j < 1 << k; j++)
      if (s[i + j] != Min) dp[j] = 0;
  }
}
