#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
inline long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
inline long long add(long long _x, long long _y,
                     long long _mod = 1000000007LL) {
  _x += _y;
  return _x >= _mod ? _x - _mod : _x;
}
inline long long sub(long long _x, long long _y,
                     long long _mod = 1000000007LL) {
  _x -= _y;
  return _x < 0 ? _x + _mod : _x;
}
inline long long mul(long long _x, long long _y,
                     long long _mod = 1000000007LL) {
  _x *= _y;
  return _x >= _mod ? _x % _mod : _x;
}
long long mypow(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 1LL;
  long long _ret = mypow(mul(_a, _a, _mod), _x >> 1, _mod);
  if (_x & 1) _ret = mul(_ret, _a, _mod);
  return _ret;
}
long long mymul(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 0LL;
  long long _ret = mymul(add(_a, _a, _mod), _x >> 1, _mod);
  if (_x & 1) _ret = add(_ret, _a, _mod);
  return _ret;
}
inline bool equal(double _x, double _y) {
  return _x > _y - 1e-9 && _x < _y + 1e-9;
}
void sleep(double sec = 1021) {
  clock_t s = clock();
  while (clock() - s < CLOCKS_PER_SEC * sec)
    ;
}
int __ = 1, _cs;
void build() {}
char c[5140];
int n, k, res;
void init() {
  scanf("%s", c);
  n = strlen(c);
  while ((1 << k) <= n) k++;
  k--;
  res = n - ((1 << k) - 1);
}
bool gt[5140][5140];
vector<pair<int, int> > v[2];
void solve() {
  v[0].push_back({0, 0});
  for (int _ = 1; _ <= res; _++) {
    int now = _ & 1, pre = 1 - now;
    v[now].clear();
    int bst = -1;
    for (size_t j = 0; j < v[pre].size(); j++) {
      int ii = v[pre][j].first;
      int used = v[pre][j].second;
      gt[ii][used] = true;
    }
    for (size_t j = 0; j < v[pre].size(); j++) {
      int ii = v[pre][j].first;
      int used = v[pre][j].second;
      int wait = ((1 << k) - 1) ^ used;
      if (ii + wait < n) {
        int val = c[ii] - 'a';
        if (bst == -1 or val < bst) {
          bst = val;
          v[now].clear();
          v[now].push_back({ii + 1, used});
        } else if (val == bst) {
          if (not gt[ii + 1][used]) {
            v[now].push_back({ii + 1, used});
          }
        }
      }
      while (wait) {
        int bt = wait & (-wait);
        wait ^= bt;
        if (not gt[ii + bt][used | bt]) {
          gt[ii + bt][used | bt] = true;
          v[pre].push_back({ii + bt, used | bt});
        }
      }
    }
    assert(bst != -1);
    putchar((char)('a' + bst));
  }
  puts("");
}
int main() {
  build();
  while (__--) {
    init();
    solve();
  }
}
