f = lambda s:s==sorted(s,key=s.index) for s in input(): print(f(list(str(s))))
3, 51, 44999911, 123456789, 222222222222222222222, 818, 8884443334, 4545, 554553, 1234567891
True True True True True False False False False False
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!