#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<time.h>
#include<map>
#include<queue>
#include<set>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
int n,f[210000],nex[210000][26],t;
char s[210000];
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	fo(i,0,25) nex[n+1][i]=n+1;
	f[n+1]=1;
	fd(i,n,1){
		fo(j,0,25) nex[i][j]=nex[i+1][j];
		nex[i][s[i]-'a']=i;
		f[i]=n+1;
		fo(j,0,25) f[i]=min(f[i],f[nex[i][j]+1]);//f[nex[i][j]]
		f[i]++;
	}
	//printf("%d\n",f[1]);
	t=1;
	while (t<=n){
		fo(i,0,25) if (nex[t][i]>n||f[nex[t][i]+1]<f[t]){//f[nex[t][i]+1]<f[i]!!!
			putchar('a'+i);
			t=nex[t][i]+1;
			break;
		
		}
	}
	return 0;
}