#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int maxn = 5e3 + 10;
const int maxl = 12;
const int maxs = 1 << maxl;
bool vis[maxn][maxs];
int n, k;
char s[maxn];
int main() {
  scanf("%s", s);
  n = strlen(s);
  k = 0;
  while ((1 << k) <= n) ++k;
  k -= 1;
  vis[0][(1 << k) - 1] = true;
  vector<pair<int, int> > q;
  q.push_back(make_pair(0, (1 << k) - 1));
  for (;;) {
    int sz = q.size();
    char nxt = 'z' + 1;
    for (int i = 0; i < q.size(); ++i) {
      int cur = q[i].first;
      int mask = q[i].second;
      nxt = min(nxt, s[cur]);
      for (int i = 0; i < k; ++i)
        if ((mask >> i) & 1) {
          int nxt = cur + (1 << i);
          int nxtm = mask ^ (1 << i);
          if (nxt <= n && !vis[nxt][nxtm]) {
            vis[nxt][nxtm] = true;
            q.push_back(make_pair(nxt, nxtm));
          }
        }
    }
    if (!nxt) break;
    vector<pair<int, int> > nq;
    for (auto e : q) {
      if (s[e.first] == nxt) {
        nq.push_back(make_pair(e.first + 1, e.second));
        vis[e.first + 1][e.second] = true;
      }
    }
    swap(q, nq);
    putchar(nxt);
  }
  putchar('\n');
}
