#include <bits/stdc++.h>
using namespace std;
char s[5010];
int n;
bool dp[5010][5010];
char ans[5010];
int main() {
  scanf("%s", s);
  n = strlen(s);
  int L = 0;
  while ((1 << (L + 1)) <= n) L++;
  int m = (1 << L);
  fill(dp[0], dp[0] + m, 1);
  for (int i = 1; i <= n - m + 1; i++) {
    copy(dp[i - 1], dp[i - 1] + m, dp[i]);
    char mn = 'z';
    for (int j = 0; j < m; j++)
      if (dp[i - 1][j]) mn = min(mn, s[i - 1 + j]);
    for (int j = 0; j < m; j++)
      if (dp[i][j] && s[i - 1 + j] != mn) dp[i][j] = 0;
    for (int j = 0; j < m; j++) {
      for (int k = 0; k < L; k++) {
        if ((j >> k) & 1) dp[i][j] |= dp[i][j ^ (1 << k)];
      }
    }
    ans[i - 1] = mn;
  }
  puts(ans);
  return 0;
}
