#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
const int K = 13;
int n;
string s;
char dp[N][N];
bool dead[N][K];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  n = ((int)(s).size());
  for (int len = 1; len <= n; len++) {
    char c = s[len - 1];
    for (int l = len - 1; l >= 0; l--) {
      int idx = len - l - 1;
      char &res = dp[l][idx];
      res = c;
      for (int m = l; m > 0; m -= m & (-m)) {
        int bit = __builtin_ctz(m);
        if (dead[l][bit]) continue;
        int pot = 1 << bit;
        res = min(res, dp[l - pot][idx]);
      }
      for (int m = l; m > 0; m -= m & (-m)) {
        int bit = __builtin_ctz(m);
        int pot = 1 << bit;
        if (res < dp[l - pot][idx]) dead[l][bit] = 1;
      }
    }
  }
  int k = 0;
  while (2 * (1 << k) <= n) ++k;
  cout << dp[(1 << k) - 1] << endl;
  return 0;
}
