#include <bits/stdc++.h>
using namespace std;
int k;
string s;
bool f[5001];
int main() {
  cin >> s;
  f[0] = 1;
  while ((1 << k) <= s.size()) k++;
  k--;
  for (int i = 0; i <= s.size() - (1 << k); i++) {
    char m = 'z';
    for (int j = 0; j < (1 << k); j++)
      if (f[j]) {
        m = min(m, s[i + j]);
        for (int l = 0; l < k; l++) f[j | (1 << l)] = true;
      }
    printf("%c", m);
    for (int j = 0; j < (1 << k); j++) f[j] &= (s[i + j] == m);
  }
  return 0;
}
