def get_ans(s):
    s,mark,ans=s[::-1],set(),''
    for i in s:
        if i not in mark: 
            ans+=i
            mark.add(i)
    return ans

if __name__=='__main__':
    s=input()
    print(get_ans(s))