#include<bits/stdc++.h>
using namespace std;
int main(){
    string str;
    cin>>str;
    unordered_set<char> set;
    for(auto iter=str.rbegin();iter!=str.rend();++iter){
        if(set.count(*iter))
            continue;
        set.insert(*iter);
        cout<<*iter;
    }
}