#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 5;
int dp[maxn][maxn];
int n;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("TEST"
            ".INP",
            "r"))
    freopen(
        "TEST"
        ".INP",
        "r", stdin),
        freopen(
            "TEST"
            ".OUT",
            "w", stdout);
  cin >> s;
  n = s.size();
  s = " " + s;
  int bit = log2(n);
  int res = n - (1 << bit) + 1;
  for (int i = 0; i < (1 << bit); ++i) dp[0][i] = 1;
  for (int i = 1; i <= res; ++i) {
    char now = 'z' + 1;
    for (int j = 0; j <= n - i; ++j)
      if (dp[i - 1][j]) now = min(now, s[i + j]);
    cout << now;
    for (int j = 0; j <= n - i; ++j) {
      if (dp[i - 1][j] == 1 && now == s[i + j]) dp[i][j] = 1;
      if (dp[i][j] == 0) continue;
      for (int t = 0; t < bit; ++t) dp[i][j | (1 << t)] = 1;
    }
  }
}
