#include <bits/stdc++.h>
using namespace std;
const int MAX_LEN = 100000 + 10;
char str[MAX_LEN];
int main(int argc, char *argv[]) {
  scanf("%s", str);
  int last = 0;
  for (char c = 'z'; c >= 'a'; c--) {
    for (int i = last; str[i]; i++)
      if (str[i] == c) {
        printf("%c", c);
        last = i;
      }
  }
  printf("\n");
  return 0;
}
