#include <bits/stdc++.h>
using namespace std;
bool dp[5003];
int main() {
  string s;
  cin >> s;
  int n = s.size(), x = log2(n);
  s = ' ' + s;
  memset(dp, 31, sizeof(dp));
  for (int i = 1; i <= n - (1 << x) + 1; i++) {
    char c = 'z';
    for (int j = 0; j < (1 << x); j++)
      if (dp[j])
        for (int k = 0; k < x; k++) dp[j | (1 << k)] = 1;
    for (int j = 0; j < (1 << x); j++)
      if (dp[j]) c = min(c, s[i + j]);
    for (int j = 0; j < (1 << x); j++) dp[j] &= (s[i + j] == c);
    cout << c;
  }
}
