#include <bits/stdc++.h>
using namespace std;
const int maxn = 111111;
char S[maxn];
int main() {
  scanf("%s", S);
  int ptr = 0;
  for (int i = 25; i >= 0; i--) {
    char ch = 'a' + i;
    for (int j = ptr; S[j]; j++) {
      if (S[j] == ch) {
        putchar(ch);
        ptr = j;
      }
    }
  }
  puts("");
}
