#include <bits/stdc++.h>
using namespace std;
const int MAX = 5004, inf = 0x3f3f3f3f;
char s[MAX], res[MAX];
int n;
char f[MAX][MAX], emp;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s + 1;
  n = strlen(s + 1);
  int Lg = log2(n);
  int m = n - (1 << Lg) + 1;
  for (int j = 1; j <= m; j++) res[j] = 'z' + 1;
  int Ma = (1 << Lg);
  bool ch[20];
  for (int i = 0; i < Ma; i++) {
    vector<int> pr;
    for (int j = 0; j < Lg; j++)
      if ((i & (1 << j)) == 0) {
        pr.push_back(j);
        ch[j] = 0;
      }
    bool tt = 0;
    int down = 0;
    if (s[i + 1] <= res[1]) {
      if (res[1] != s[i + 1]) tt = 1;
      res[1] = s[i + 1];
      if (f[i][1] != res[1]) {
        down = 1;
      }
      f[i][1] = res[1];
    }
    int endn = m;
    for (int j = 1; j <= m; j++)
      if (f[i][j] == res[j]) {
        for (int u : pr)
          if (f[i | (1 << u)][j] != res[j]) {
            ch[u] = 1;
            f[i | (1 << u)][j] = res[j];
          }
        if (s[i + j + 1] <= res[j + 1] || tt) {
          if (s[i + 1 + j] < res[j + 1] || tt)
            tt = 1;
          else {
            if (f[i][j + 1] != res[j + 1]) {
              down = j + 1;
            }
          }
          res[j + 1] = s[i + j + 1];
          f[i][j + 1] = res[j + 1];
        }
        if (down == j) {
          f[i][j + 1] = s[i + j + 1];
          down = j + 1;
        }
      } else {
        endn = j - 1;
        break;
      }
    for (int u : pr)
      if (ch[u]) {
        for (int j = endn + 1; j <= m; j++) f[i | (1 << u)][j] = emp;
      }
  }
  for (int i = 1; i <= m; i++) cout << f[Ma - 1][i];
}
