BubbleRing
A sequence of letters is written on a miraculous ring. When the sequence is read aloud starting from any letter, magic happens. To get the greatest magic, you need the most powerful word: you want to find a place to start reading from so that the word you get is the greatest possible word in the alphabetical order.
InputOne string, consisting of English capital letters A - Z. The number of letters is at least 1 and at most 100000.
OutputTwo numbers in one line, separated by a space. The first number is the number of places from which the most powerful word can be achieved. The second number is the smallest index of the starting letter, (counting from one), that gives the most powerful word.
Input
ABRACADABRACADOutput:
2 3Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.