#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

const int MAX_N = 200005;

int pos[MAX_N][26], N, f[MAX_N];
char s[MAX_N];

int main() {
  scanf("%s", s + 1), N = strlen(s + 1);
  for (int i = 0; i < 26; ++i) pos[N + 1][i] = N + 1;
  
  for (int i = N; i; --i) {
    memcpy(pos[i], pos[i + 1], sizeof pos[i]);
    pos[i][s[i] - 'a'] = i;
  }

  f[N + 1] = 0;
  for (int i = N; i; --i) {
    int mn = N + 1;
    for (int j = 0; j < 26; ++j)
      if (f[pos[i + 1][j]] < mn)
	mn = f[pos[i + 1][j]];
    f[i] = mn + 1;
  }
  
  int now = 0;
  while (now < N + 1) {
    int mn = N + 1, mnid = 0;
    for (int i = 0; i < 26; ++i)
      if (f[pos[now + 1][i]] < mn)
	mn = f[pos[now + 1][i]], mnid = i;
    putchar(mnid + 'a');
    now = pos[now + 1][mnid];
  }
  puts("");
  return 0;
}
