while 1:a=zip(raw_input());print(a>sorted(a))^1