#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int main(int argc, char **argv) {
  char s[N];
  int n = fread(s, 1, N, stdin);
  int p = 0;
  for (char c = 'z'; c >= 'a'; c--)
    for (int i = p; i < n; i++)
      if (s[i] == c) {
        putchar(c);
        p = i + 1;
      }
  return 0;
}
