#include <bits/stdc++.h>
using namespace std;
string solve(string &str) {
  string ans;
  int len = str.length();
  int idx = 0;
  for (int i = 25; i >= 0; i--) {
    char ch = (char)(i + 'a');
    for (int j = idx; j < len; j++) {
      if (str[j] == ch) {
        ans.push_back(ch);
        idx = j + 1;
      }
    }
  }
  return ans;
}
int main() {
  string str;
  cin >> str;
  cout << solve(str) << endl;
  return 0;
}
