#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(a,b,c) for (int a=b;a<=c;a++)
#define per(a,b,c) for (int a=b;a>=c;a--)
using namespace std;
typedef long long LL;
const int N=400010;
int a[N],pre[N],nxt[26],to[N][26],n,h,t,q[N];
char s[N];
void pri(int x){
	if (!x) return;
	pri(pre[x]);
	putchar('a'+a[x]);
}
int main(){
	scanf("%s",s+1),n=strlen(s+1);
	rep(i,1,n) a[i]=s[i]-'a';
	rep(i,0,25) nxt[i]=n+1;
	per(i,n,0){
		memcpy(to[i],nxt,sizeof(nxt));
		nxt[a[i]]=i;
	}
	q[h=t=1]=0;
	int fnd=0;
	memset(pre,-1,sizeof(pre));
	while (h<=t){
		rep(i,0,25) if (!fnd){
			int son=to[q[h]][i];
			if (son[pre]!=-1) continue;
			q[++t]=son;
			fnd=son==n+1;
			son[a]=i;
			son[pre]=q[h];
		}
		++h;
	}
	pri(n+1);
	return 0;
}
