#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,no-stack-protector")
using namespace std;
function<void(void)> ____ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
};
template <typename T>
vector<T> &operator<<(vector<T> &__container, T x) {
  __container.push_back(x);
  return __container;
}
template <typename T>
ostream &operator<<(ostream &out, vector<T> &__container) {
  for (T _ : __container) out << _ << ' ';
  return out;
}
const int MAXN = 5e3 + 7;
char s[MAXN];
int n;
bool f[MAXN];
void solve() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int k = (int)log2(n), M = 1 << k;
  f[0] = 1;
  for (int i = 1; i <= n - M + 1; i++) {
    for (int msk = 0; msk < M; msk++)
      if (f[msk])
        for (int bit = 0; bit < k; bit++) f[msk | (1 << bit)] = true;
    char best = 'z';
    for (int msk = 0; msk < M; msk++)
      if (f[msk]) ((best) = (best) < (s[msk + i]) ? (best) : (s[msk + i]));
    for (int msk = 0; msk < M; msk++) f[msk] &= (s[msk + i] == best);
    cout << best;
  }
  cout << "\n";
}
int main() {
  solve();
  return 0;
}
