#include <bits/stdc++.h>
using namespace std;
const int N = 5000 + 10;
int n, K;
vector<pair<int, int> > can[26], cur;
char str[N];
bool vis[N][N];
void dfs(int x, int s) {
  if (vis[x][s]) return;
  vis[x][s] = true;
  if (str[x + 1 + s]) can[str[x + 1] - 'a'].push_back(make_pair(x + 1, s));
  for (int i = 0; (1 << i) <= s; ++i)
    if (s >> i & 1) dfs(x + (1 << i), s - (1 << i));
}
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1), K = 1;
  while ((K << 1) <= n) K <<= 1;
  cur.push_back(make_pair(0, K - 1));
  while (true) {
    for (auto x : cur) dfs(x.first, x.second);
    int c = -1;
    for (int i = 25; i >= 0; --i)
      if (can[i].size()) c = i;
    if (c < 0) break;
    putchar('a' + c);
    cur.swap(can[c]);
    for (int i = 0; i < 26; ++i) can[i].clear();
  }
}
