#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, answer;
  cin >> s;
  answer = "";
  int last = 0;
  for (int i = 25; i >= 0; i--) {
    for (int j = last; j < s.size(); j++) {
      if (s[j] - 97 == i) {
        answer += s[j];
        last = j;
      }
    }
  }
  cout << answer << endl;
}
