#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 10;
const int NN = 1 << 12;
char A[N];
bool vis[N][NN];
char Out[N];
struct T {
  int x, y;
};
vector<T> Q, Q1;
int main() {
  scanf("%s", &A[1]);
  int n = strlen(&A[1]), pos = (1 << (int)log2(n)) - 1;
  Q.push_back({1, 0});
  int C = log2(n);
  for (int t = 0; t < n - pos; t++) {
    char Min = 'z';
    int q = 0;
    while (q < Q.size()) {
      auto j = Q[q++];
      int i = j.x;
      for (int k = 0; k < C; k++) {
        int g = 1 << k;
        if (j.y & g) continue;
        if (!vis[i + g][j.y | g]) {
          vis[i + g][j.y | g] = true;
          Q.push_back({i + g, j.y | g});
        }
      }
      if (A[j.x] < Min) Min = A[j.x];
    }
    for (auto f : Q)
      if (A[f.x] == Min) {
        vis[f.x + 1][f.y] = true;
        Q1.push_back({f.x + 1, f.y});
      }
    Q = Q1;
    Q1.clear();
    Out[t] = Min;
  }
  Out[n - pos] = '\0';
  cout << Out << '\n';
}
