#include <bits/stdc++.h>
using namespace std;
const int maxn = 5000;
char s[maxn + 5];
bool dp[maxn + 5][maxn + 5];
int n, l, m;
string ans;
int main() {
  scanf("%s", s);
  n = strlen(s);
  l = 0;
  while ((1 << (l + 1)) <= n) ++l;
  m = 1 << l;
  for (int j = 0; j < m; ++j) dp[0][j] = 1;
  for (int i = 1; i <= n - m + 1; ++i) {
    for (int j = 0; j < m; ++j) dp[i][j] = dp[i - 1][j];
    char mi = 'z';
    for (int j = 0; j < m; ++j)
      if (dp[i - 1][j]) mi = min(mi, s[i - 1 + j]);
    for (int j = 0; j < m; ++j)
      if (dp[i][j] && s[i - 1 + j] != mi) dp[i][j] = 0;
    for (int j = 0; j < m; ++j)
      for (int k = 0; k < l; ++k)
        if (j & (1 << k)) dp[i][j] |= dp[i][j ^ (1 << k)];
    ans = ans + mi;
  }
  cout << ans << endl;
}
