#include <bits/stdc++.h>
using namespace std;

const int N = 2e5 + 5;

int nxt[N][26];

int go[26], n;

string s;

int dp[N];

int solve(int idx){

  if(idx == n + 1)return dp[idx] = 0;

  int &ret = dp[idx];

  if(~ret)return ret;

  ret = INT_MAX;

  for(int j = 0; j < 26; j++)
    ret = min(ret, 1 + solve(nxt[idx][j]));


  return ret;
}

void build(int idx){

  if(idx == n + 1)exit(0);

  for(int j = 0; j < 26; j++){
    if(dp[idx] == 1 + dp[nxt[idx][j]]){
      putchar('a' + j);
      build(nxt[idx][j]);
    }

  }

}

int main(){

  memset(dp, -1, sizeof dp);

  cin >> s;

  n = s.size();

  for(int i = 0; i < 26; i++)go[i] = n + 1;

  for(int i = n - 1; i >= -1; i--){

    for(int j = 0; j < 26; j++)
      nxt[i + 1][j] = go[j];

    if(i == -1)break;;

    go[s[i]-'a'] = i + 1;

  }

  solve(0);
  build(0);





  return 0;
}
