无脑字符串解题。
while True: try: a = int(input()) s = str(a)[::-1] l = [] for i in s: if i not in l: l.append(i) for i in l: print(i,end='') except: break