#include <bits/stdc++.h>
using namespace std;
int k, n, del, use;
bool dp[5005][5005];
string s;
void pre() {
  n = ((int)s.size()) - 1;
  k = log2(n);
  del = (1 << (k)) - 1;
  use = n - del;
  char mn = *min_element(s.begin() + 1, s.begin() + del + 1);
  for (int i = 1; i <= del + 1; i++) {
    if (s[i] == mn) {
      dp[0][i - 1] = 1;
    }
  }
  for (int us = 1; us <= use; us++) {
    for (int mask = 0; mask + us <= n; mask++) {
      for (int b = 0; b < k; b++) {
        if (mask & (1 << (b))) {
          dp[us][mask] |= dp[us][mask - (1 << (b))];
        }
      }
      dp[us][mask] |= dp[us - 1][mask];
    }
    char mn = 'z' + 1;
    for (int i = 1; i <= n; i++) {
      if (dp[us][i - us]) {
        mn = min(mn, s[i]);
      }
    }
    for (int i = 1; i <= n; i++) {
      if (s[i] != mn) dp[us][i - us] = 0;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  s = "0" + s;
  pre();
  int cp = use, mask = del;
  while (!dp[cp][mask]) mask--;
  string ans;
  while (cp) {
    ans.push_back(s[cp + mask]);
    for (int dec = 0; dec <= mask; dec++) {
      if ((mask & dec) == dec && dp[cp - 1][mask - dec]) {
        cp--;
        mask -= dec;
        break;
      }
    }
  }
  reverse(ans.begin(), ans.end());
  cout << ans;
}
