#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        string str=to_string(n);
        for(int i=0;i<str.size();i++)//去掉重复数字,如果重复,则将前面重复那个数置为一个字符
        {
            for(int j=0;j<i;j++)
            if(str[i]==str[j])
            {
                str[j]='A';
            }
        }
        for(int j=str.size()-1;j>=0;j--)//反向输出
        {
            if(str[j]!='A')
            {
                cout<<str[j];
            }
        }
        cout<<endl;
    }
}