#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rand(long long l, long long r) {
  uniform_int_distribution<long long> uid(l, r);
  return uid(rng);
}
const int LOGN = 14;
bool dp[(1 << LOGN)];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int n = (int)s.size();
  s = '0' + s;
  int k = log2(n);
  int nn = n - (1 << k) + 1;
  vector<int> v;
  v.push_back((1 << k) - 1);
  string ans = "";
  for (int i = 1; i <= nn; i++) {
    fill(dp, dp + (1 << k), 0);
    for (int mask : v) {
      dp[mask] = 1;
    }
    for (int j = 0; j <= k - 1; j++) {
      for (int mask = 0; mask <= (1 << k) - 1; mask++) {
        if (!((mask >> j) & 1)) {
          dp[mask] |= dp[mask ^ (1 << j)];
        }
      }
    }
    char ch = 'z' + 1;
    for (int mask = 0; mask <= (1 << k) - 1; mask++) {
      int p = i + (1 << k) - mask - 1;
      if (p <= n && dp[mask]) {
        ch = min(ch, s[p]);
      }
    }
    v.clear();
    for (int mask = 0; mask <= (1 << k) - 1; mask++) {
      int p = i + (1 << k) - mask - 1;
      if (p <= n && dp[mask] && s[p] == ch) v.push_back(mask);
    }
    ans += ch;
  }
  cout << ans;
  return 0;
}
