#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 5;
const int mod = 1e9 + 7;
int n, cnt = 0;
string s, res;
vector<int> bits[maxn];
vector<pair<int, int> > cur;
bool dp[maxn][maxn];
void init() {
  while (n > (1 << cnt)) {
    n -= (1 << cnt);
    cnt++;
  }
  for (int i = 0; i < (1 << cnt); ++i)
    for (int j = 0; j < cnt; ++j)
      if (!(i & (1 << j))) bits[i].push_back(j);
  cur.push_back(pair<int, int>(0, 0));
  dp[0][0] = 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  init();
  int dem = 0;
  while (dem < n) {
    char ans = 'z';
    for (int i = 0; i < cur.size(); ++i) {
      auto x = cur[i];
      int pos = x.first;
      int mark = x.second;
      for (auto j : bits[mark]) {
        int newpos = pos + (1 << j);
        int newmark = mark ^ (1 << j);
        if (!dp[newpos][newmark]) {
          dp[newpos][newmark] = 1;
          cur.push_back(pair<int, int>(newpos, newmark));
        }
      }
      ans = min(ans, s[pos]);
    }
    vector<pair<int, int> > newcur;
    for (auto x : cur)
      if (s[x.first] == ans) {
        dp[x.first + 1][x.second] = 1;
        newcur.push_back(pair<int, int>(x.first + 1, x.second));
      }
    cur = newcur;
    cout << ans;
    dem++;
  }
}
