#include <bits/stdc++.h>
using namespace std;
char s[5100];
bool dp[5100][5100];
int main() {
  int n;
  cin >> (s + 1);
  n = strlen(s + 1);
  int k = 0, tmp = 1;
  while (tmp <= n) tmp *= 2, k++;
  tmp /= 2;
  tmp--;
  k--;
  for (int i = 0; i <= tmp; i++) dp[i][0] = 1;
  for (int j = 1; j <= n - tmp; j++) {
    char c = 'z';
    for (int i = 1; i <= n; i++) {
      if (dp[i - 1][j - 1]) {
        c = min(c, s[i]);
      }
    }
    printf("%c", c);
    for (int i = 1; i <= n; i++) {
      if (dp[i - 1][j - 1] && s[i] == c) {
        dp[i][j] = 1;
      }
    }
    for (int i = j + 1; i <= n; i++) {
      if (i - j > tmp) continue;
      for (int c = 0; c <= k; c++) {
        int t = i - j;
        if ((t & (1 << c))) {
          int id = i - (1 << c);
          if (dp[id][j]) dp[i][j] = 1;
        }
      }
    }
  }
  puts("");
  return 0;
}
