#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int idx = 0;
  for (int i = 25; i >= 0; i--) {
    for (int k = idx; k < (int)(((int)s.size())); k++)
      if (s[k] - 'a' == i) cout << s[k], idx = k + 1;
  }
  return 0;
}
