#include <bits/stdc++.h>
using namespace std;
long long int modmulti(long long int a, long long int b, long long int m) {
  return ((a % m) * (b % m)) % m;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, long long int y, long long int m) {
  if (y == 0) return 1;
  long long int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long int power2(long long int x, long long int y) {
  if (y == 0) return 1;
  long long int p = power2(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
bool cmp(pair<long long int, long long int>& a,
         pair<long long int, long long int>& b) {
  if (a.first == b.first)
    return (a.second < b.second);
  else
    return (a.first > b.first);
}
long long int bin(vector<long long int> a, long long int left,
                  long long int right, long long int x) {
  long long int mid = left + (right - left) / 2;
  if (a[mid] == x) return mid;
  if (left <= right) {
    if (a[mid] < x)
      return bin(a, mid + 1, right, x);
    else if (a[mid] > x)
      return bin(a, left, mid - 1, x);
  }
  return -1;
}
long long int findclosest(long long int n) {
  long long int i;
  for (i = 0; i <= 64; i++) {
    if (power2(2, i) <= n)
      continue;
    else
      break;
  }
  return power2(2, i - 1);
}
long long int get_signi(long long int n) {
  while (n >= 10) {
    n = n / 10;
  }
  return n;
}
long long int get_digits(long long int n) {
  long long int i = 0;
  while (n >= 10) {
    n = n / 10;
    i++;
  }
  return i;
}
bool is_palindrome(string t) {
  for (int i = 0; i < t.size() / 2; i++) {
    if (t[i] != t[t.size() - i - 1]) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string second;
  cin >> second;
  string t = "";
  long long int last_index = 0, i, j;
  for (i = 0; i < 26; i++) {
    for (j = last_index; j < second.size(); j++) {
      if (second[j] == 'a' + 25 - i) {
        t += second[j];
        last_index = j;
      }
    }
  }
  cout << t << "\n";
  return 0;
}

### Prompt

Please formulate a Cpp solution to the following problem:

You've got string s, consisting of only lowercase English letters. Find its lexicographically maximum subsequence.

We'll call a non-empty string s[p1p2... pk] = sp1sp2... spk(1 ≤ p1 < p2 < ... < pk ≤ |s|) a subsequence of string s = s1s2... s|s|.

String x = x1x2... x|x| is lexicographically larger than string y = y1y2... y|y|, if either |x| > |y| and x1 = y1, x2 = y2, ... , x|y| = y|y|, or exists such number r (r < |x|, r < |y|), that x1 = y1, x2 = y2, ... , xr = yr and xr + 1 > yr + 1. Characters in lines are compared like their ASCII codes.

Input

The single line contains a non-empty string s, consisting only of lowercase English letters. The string's length doesn't exceed 105.

Output

Print the lexicographically maximum subsequence of string s.

Examples

Input

ababba


Output

bbba


Input

abbcbccacbbcbaaba


Output

cccccbba

Note

Let's look at samples and see what the sought subsequences look like (they are marked with uppercase bold letters).

The first sample: aBaBBA

The second sample: abbCbCCaCbbCBaaBA

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long int modmulti(long long int a, long long int b, long long int m) {
  return ((a % m) * (b % m)) % m;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, long long int y, long long int m) {
  if (y == 0) return 1;
  long long int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long int power2(long long int x, long long int y) {
  if (y == 0) return 1;
  long long int p = power2(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
bool cmp(pair<long long int, long long int>& a,
         pair<long long int, long long int>& b) {
  if (a.first == b.first)
    return (a.second < b.second);
  else
    return (a.first > b.first);
}
long long int bin(vector<long long int> a, long long int left,
                  long long int right, long long int x) {
  long long int mid = left + (right - left) / 2;
  if (a[mid] == x) return mid;
  if (left <= right) {
    if (a[mid] < x)
      return bin(a, mid + 1, right, x);
    else if (a[mid] > x)
      return bin(a, left, mid - 1, x);
  }
  return -1;
}
long long int findclosest(long long int n) {
  long long int i;
  for (i = 0; i <= 64; i++) {
    if (power2(2, i) <= n)
      continue;
    else
      break;
  }
  return power2(2, i - 1);
}
long long int get_signi(long long int n) {
  while (n >= 10) {
    n = n / 10;
  }
  return n;
}
long long int get_digits(long long int n) {
  long long int i = 0;
  while (n >= 10) {
    n = n / 10;
    i++;
  }
  return i;
}
bool is_palindrome(string t) {
  for (int i = 0; i < t.size() / 2; i++) {
    if (t[i] != t[t.size() - i - 1]) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string second;
  cin >> second;
  string t = "";
  long long int last_index = 0, i, j;
  for (i = 0; i < 26; i++) {
    for (j = last_index; j < second.size(); j++) {
      if (second[j] == 'a' + 25 - i) {
        t += second[j];
        last_index = j;
      }
    }
  }
  cout << t << "\n";
  return 0;
}

```