f = lambda s:s==sorted(s,key=s.index)
 
for s in input():
    print(f(list(str(s))))