#include <stdio.h>
#include <string.h>

int main() {
    char s[10];
    char n = 0;
    scanf("%s", s);
    n = strlen(s);
    for(int i = n - 1; i >= 0; i--)
    {
        if(s[i] != 'a')
        {
            printf("%c", s[i]);
            for(int j = i - 1; j >= 0; j--)
            {
                if(s[i] == s[j])
                {
                    s[j] = 'a';
                }
            }
        }

    }


    return 0;
}