#include<bits/stdc++.h>
using namespace std;
int nxt[200005][30], dp[200005], n, last[30];
char s[200005];
int main() {
	scanf("%s", s + 1);
	n = strlen(s + 1);
	for (int i = 0; i < 26; i ++) nxt[n + 1][i] = n + 1;
	dp[n + 1] = 1;
	for (int i = n; i >= 1; i --) {
		for (int j = 0; j < 26; j ++) nxt[i][j] = nxt[i + 1][j];
		nxt[i][s[i] - 'a'] = i; dp[i] = n + 1;
		for (int j = 0; j < 26; j ++) {
			dp[i] = min(dp[i], dp[nxt[i][j] + 1]);
		} dp[i] ++;
	}
	int t = 1;
	while (t <= n) {
		for (int i = 0; i < 26; i ++) {
			if (nxt[t][i] > n || dp[nxt[t][i] + 1] < dp[t]) {
				putchar('a' + i); t = nxt[t][i] + 1;
				break;				
			}
		}
	} puts("");
	return 0;
}