#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream& operator>>(istream& is, vector<T>& a) {
  for (T& ai : a) is >> ai;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> const& a) {
  os << "[ ";
  for (const T& ai : a) os << ai << " ";
  return os << "]";
}
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& a) {
  return is >> a.first >> a.second;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> const& a) {
  return os << "(" << a.first << ", " << a.second << ")";
}
string f() {
  string s;
  cin >> s;
  int n = s.size();
  int k = 0;
  while (2 << k <= n) ++k;
  int m = 1 + n - (1 << k);
  string r(m, 'z' + 1);
  string a(1 << k, 'z' + 1);
  for (int j = 0; j < 1 << k; ++j) r[0] = min(r[0], s[j]);
  for (int j = 0; j < 1 << k; ++j) {
    if (s[j] == r[0]) a[j] = s[j];
  }
  for (int i = 0; i < m - 1; ++i) {
    string b(1 << k, 'z' + 1);
    for (int j = 0; j < 1 << k; ++j) {
      if (a[j] > r[i]) continue;
      for (int t = 0; t < k; ++t) {
        if (j & (1 << t)) continue;
        a[j | (1 << t)] = min(a[j | (1 << t)], a[j]);
      }
      b[j] = min(b[j], s[i + 1 + j]);
      r[i + 1] = min(r[i + 1], s[i + 1 + j]);
    }
    swap(a, b);
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << f() << "\n";
  return 0;
}
