#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5;
char s[N], res[N];
int n, t;
bool f[N][N], vis[N];
inline int read() {
  int x, f = 1;
  char ch;
  while (!(isdigit(ch = getchar()))) ch == '-' ? f = -1 : f;
  x = ch ^ 48;
  while ((isdigit(ch = getchar()))) x = (x << 1) + (x << 3) + (ch ^ 48);
  return f * x;
}
int main() {
  scanf(" %s", s + 1);
  n = strlen(s + 1);
  while ((1 << (t + 1)) <= n) t++;
  f[0][0] = 1;
  for (int i = 0; i < n - (1 << t) + 1; i++) {
    int mn = 300, tot = 0;
    for (int j = 0; j < (1 << t); j++) vis[j] = 0;
    for (int j = 0; j < (1 << t); j++) {
      if (f[i][j]) vis[j] = 1;
      if (vis[j]) {
        for (int k = 0; k < t; k++) {
          vis[j | (1 << k)] = 1;
        }
      }
    }
    for (int j = 0; j < (1 << t); j++) {
      if (vis[j]) {
        mn = min(mn, (int)s[i + 1 + j]);
      }
    }
    for (int j = 0; j < (1 << t); j++) {
      if (vis[j] && (int)s[i + 1 + j] == mn) {
        f[i + 1][j] = 1;
      }
    }
    res[i + 1] = mn;
  }
  printf("%s", res + 1);
  return 0;
}
