#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 10;
int n;
string ans;
char s[maxn];
int dp[maxn];
inline void setMin(char &a, char b) {
  if (a > b) {
    a = b;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  char currc;
  int i, j, k, K, S, M;
  cin >> s;
  n = strlen(s);
  for (K = 0; (n >> K) > 1; K++)
    ;
  S = (1 << K) - 1;
  M = n - S;
  dp[0] = 1;
  for (i = (1); i <= (M); i++) {
    currc = 'z' + 1;
    for (j = (0); j <= (S); j++) {
      if (!dp[j]) {
        continue;
      }
      setMin(currc, s[i + j - 1]);
      for (k = (0); k <= (K - 1); k++) {
        if (!(j & (1 << k))) {
          dp[j | (1 << k)] = 1;
        }
      }
    }
    for (j = (0); j <= (S); j++) {
      if (!dp[j]) {
        continue;
      }
      if (s[i + j - 1] != currc) {
        dp[j] = 0;
      }
    }
    ans += currc;
  }
  cout << ans << endl;
  return 0;
}
