def fun(s): for i, si in enumerate(s): if ord(si) < ord("a"): break return s[:i][::-1] + s[i:] s = input() print(fun(s))