Consider the following string transformation:
append the character # to the string (we assume that # is lexicographically smaller than all other characters of the string)generate all rotations of the stringsort the rotations in increasing orderbased on this order, construct a new string that contains the last character of each rotation
For example, the string babc becomes babc# . Then, the sorted list of rotations is #babc , abc#b , babc# , bc#ba , and c#bab . This yields a string cb#ab .
The only input line contains the transformed string of length $n+1$ . Each character of the original string is one of a–z.
Print the original string of length $n$ .