In his youth, Horatio was fond of composing full heraldic names. This is not an easy job—make a mistake somewhere, and some duke will immediately send you off to Yorick. The rules are quite simple: a duke tells Horatio his ancestral title, and Horatio finds its lexicographically minimal cyclic shift. Not everyone in the Danish kingdom can do this!
But now such unserious activities are not fitting for Horatio, and he needs a successor. Try your hand at this task!
The only line contains the duke's ancestral title, consisting of lowercase Latin letters, with a length not exceeding characters.
Print the correct heraldic name of the duke.
Example 1