#include <bits/stdc++.h>
using namespace std;
const int N = 5010;
const int MOD = 1000000007;
vector<pair<int, int> > st;
bool dp[N][N];
string s;
int main() {
  cin >> s;
  int fn = s.size(), cur = 1, k = 0;
  while (fn > cur) fn -= cur, cur *= 2, ++k;
  string ans = "";
  dp[0][0] = 1;
  st.push_back(make_pair(0, 0));
  while (ans.size() < fn) {
    char mn = 'z';
    for (int i = 0; i < st.size(); ++i) {
      pair<int, int> cur = st[i];
      for (int j = 0; j < k; ++j) {
        if (((1 << j) & cur.second) == 0 &&
            dp[cur.first + (1 << j)][cur.second ^ (1 << j)] == 0) {
          st.push_back(make_pair(cur.first + (1 << j), cur.second ^ (1 << j)));
          dp[cur.first + (1 << j)][cur.second ^ (1 << j)] = 1;
        }
      }
      mn = min(mn, s[cur.first]);
    }
    ans += mn;
    vector<pair<int, int> > nw;
    for (int i = 0; i < st.size(); ++i) {
      if (s[st[i].first] == mn) {
        dp[st[i].first + 1][st[i].second] = 1;
        nw.push_back(make_pair(st[i].first + 1, st[i].second));
      }
    }
    st = nw;
  }
  cout << ans << endl;
  return 0;
}
