#include <bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
char a[200010];
int d[200010];
int nxt[200010][30];
int main()
{


    scanf("%s", a);
    int n = strlen(a);
    d[n] = 1;
    d[n + 1] = 0;
    for (int i = 0; i < 26; i++) {
        nxt[n][i] = n;
    }
    for (int i = n - 1; i >= 0; i--) {
        for (int j = 0; j < 26; j++) {
            nxt[i][j] = nxt[i + 1][j];
        }
        nxt[i][a[i] - 'a'] = i;
        d[i] = inf;
        for (int j = 0; j < 26; j++) {
            d[i] = min(d[i], d[nxt[i][j] + 1] + 1);
        }
    }
    int loc = 0;
    while (loc != n + 1) {
        int j = 0;
        while (d[nxt[loc][j] + 1] + 1 != d[loc]) j++;
        putchar('a' + j);
        loc = nxt[loc][j] + 1;
    }
    puts("");
}
