#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)

using P = pair<char,int>;

string s;
int main(){
  cin >> s;
  vector<int> dp(s.size() + 2,1e9);
  dp[s.size() + 1] = 0;
  dp[s.size()] = 1;
  vector<int> from(26,s.size() + 1);
  vector<P> rev(s.size() + 1);
  rev[s.size()] = {'a',s.size() + 1};

  for(int i = s.size() - 1;i >= 0;i--){
    from[s[i] - 'a'] = i + 1;
    rep(j,0,25){
      if(dp[from[j]] + 1 < dp[i]){
        dp[i] = dp[from[j]] + 1;
        rev[i] = {j + 'a' , from[j]};
      }
    }
  }

  int now = 0;
  while(now < s.size() + 1){
    cout << rev[now].first;
    now = rev[now].second;
  }

  cout << endl;
}
