#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2, class T3 = hash<T1>>
using umap = unordered_map<T1, T2, T3>;
template <class T>
using uset = unordered_set<T>;
template <class T>
using vec = vector<T>;
const long long infll = numeric_limits<long long>::max() >> 1;
const int inf = numeric_limits<int>::max() >> 1;
const int N = 5001;
int n, m, k;
string t;
string ans;
vec<pair<int, int>> opt;
bool ok[N][N];
void input() {
  cin >> t;
  n = (int)t.size();
  m = n;
  for (int p = 1; p < m; p *= 2) {
    m -= p;
    k += p;
  }
  t += "#";
}
void solve() {
  ok[0][k] = 1;
  opt.push_back({0, k});
  for (int i = 1; i <= m; ++i) {
    char next = 'z';
    for (int j = 0; j < (int)opt.size(); ++j) {
      pair<int, int> e = opt[j];
      int mask = e.second;
      for (int x = mask; x; x -= ((x) & -(x))) {
        int y = ((x) & -(x));
        if (!ok[e.first + y][mask - y]) {
          ok[e.first + y][mask - y] = 1;
          opt.push_back({e.first + y, mask - y});
        }
      }
      next = min(next, t[e.first]);
    }
    vec<pair<int, int>> new_opt;
    for (pair<int, int> e : opt) {
      if (t[e.first] == next) {
        ok[e.first + 1][e.second] = 1;
        new_opt.push_back({e.first + 1, e.second});
      }
    }
    opt = new_opt;
    ans += next;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  input();
  solve();
}
