#include <bits/stdc++.h>
using namespace std;
const int maxn = 5000 + 10;
char s[maxn];
bool dp[maxn][maxn];
string ans;
int main() {
  cin >> s;
  int n = strlen(s), p = 0;
  while ((1 << p) <= n) p++;
  p--;
  int m = 1 << p;
  for (int i = 0; i < m; i++) dp[0][i] = 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 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 < p; k++)
        if ((j >> k) & 1) dp[i][j] |= dp[i][j ^ (1 << k)];
    ans += mn;
  }
  cout << ans << endl;
  return 0;
}
