#include <bits/stdc++.h>
using namespace std;
const int INF = 2e16;
const int MB = 20;
const int MOD = 1e9 + 7;
const int maxN = 5001;
bool dp[maxN][maxN];
vector<int> to[maxN];
void solve() {
  string s;
  cin >> s;
  int n = s.size();
  int cnt = 0;
  while ((1 << cnt) <= n) {
    cnt++;
  }
  cnt--;
  int sz = 1;
  int final_sz = n;
  while (final_sz - sz > 0) {
    final_sz -= sz;
    sz *= 2;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < cnt; j++) {
      if (!((i >> j) & 1)) to[i].push_back(j);
    }
  }
  vector<pair<int, int>> now = {{0, 0}};
  dp[0][0] = true;
  string ans;
  while (ans.size() < final_sz) {
    char mn = 'z';
    for (int i = 0; i < now.size(); i++) {
      auto p = now[i];
      mn = min(mn, s[p.first]);
      for (int j : to[p.second]) {
        if (!dp[p.first + (1 << j)][p.second ^ (1 << j)]) {
          dp[p.first + (1 << j)][p.second ^ (1 << j)] = true;
          now.push_back({p.first + (1 << j), p.second ^ (1 << j)});
        }
      }
    }
    ans.push_back(mn);
    vector<pair<int, int>> nw;
    for (auto& p : now) {
      if (s[p.first] == mn) {
        if (!dp[p.first + 1][p.second]) {
          nw.push_back({p.first + 1, p.second});
          dp[p.first + 1][p.second] = true;
        }
      }
    }
    swap(nw, now);
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed;
  cout.precision(12);
  int t = 1;
  while (t--) solve();
}
