#include<iostream>
#include<set>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
set<int>se;
int s=n/10;
int y=n%10;
int res=0;
while(s)
{
if(se.count(y)==0)
{
se.insert(y);
res=res*10;
res+=y;
}
y=s%10;
s/=10;
}
if(se.count(y)==0)
{
se.insert(y);
res=res*10;
res+=y;
}
cout<<res<<endl;
}
return 0;
}