#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005, SIGMA = 26;

int n, f[MAXN], nxt[MAXN][SIGMA];
char str[MAXN];

int main(){
	int i, j;
	scanf("%s", str + 1);
	n = strlen(str + 1), f[n] = 1;
	for(i = 0; i < SIGMA; ++ i)
		nxt[n][i] = n + 1;
	for(i = n - 1; i >= 0; -- i){
		memcpy(nxt[i], nxt[i + 1], sizeof(nxt[i]));
		nxt[i][str[i + 1] - 'a'] = i + 1;
		for(f[i] = f[nxt[i][0]], j = 1; j < SIGMA; ++ j)
			f[i] = min(f[i], f[nxt[i][j]]);
		++ f[i];
	}
	for(i = 0; i <= n; i = nxt[i][j]){
		for(j = 0; j < SIGMA; ++ j)
			if(f[i] == f[nxt[i][j]] + 1)
				break;
		putchar(j + 'a');
	} return 0;
}