#include<bits/stdc++.h> using namespace std; int main() { string str; cin>>str; set set; reverse(str.begin(),str.end()); string res; for(char c:str) { if(set.count(c)!=1){ res += c; set.insert(c); } } cout<<stoi(res)<<endl; }