#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vpii = vector<pii>;
template <class T>
inline bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
inline bool ckmax(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const char nl = '\n';
const int mxN = 5000;
const int MOD = 1e9 + 7;
const ll infLL = 1e18;
const ld eps = 1e-6;
string second;
int n;
int dp[mxN][mxN], nxt[mxN];
vi trans[mxN];
string res;
int32_t main() {
  cin.tie(0)->sync_with_stdio(0);
  cin >> second;
  n = (int)second.size();
  int p2;
  for (p2 = 0; (1 << p2) - 1 < n; p2++)
    ;
  p2--;
  string res = "";
  for (int i = (0); i < (1 << p2); i++) {
    for (int j = (0); j < (p2); j++)
      if (!((1 << j) & i)) trans[i].push_back(j);
  }
  dp[0][0] = 1;
  vpii cur;
  cur.push_back({0, 0});
  while ((int)res.size() != n - (1 << p2) + 1) {
    char mn = 'z';
    for (int i = (0); i < ((int)cur.size()); i++) {
      auto x = cur[i];
      for (auto j : trans[x.second]) {
        if (dp[x.first + (1 << j)][x.second | (1 << j)] == 0) {
          cur.push_back({x.first + (1 << j), x.second | (1 << j)});
          dp[x.first + (1 << j)][x.second | (1 << j)] = 1;
        }
      }
      ckmin(mn, second[x.first]);
    }
    vpii nxt;
    res += mn;
    for (auto x : cur) {
      if (second[x.first] == mn) {
        dp[x.first + 1][x.second] = 1;
        nxt.push_back({x.first + 1, x.second});
      }
    }
    swap(nxt, cur);
  }
  cout << res << nl;
}
