URI Online Judge | 2975

Ring

By MicrosoftRS Serbia

Timelimit: 1

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.

Input

One string, consisting of English capital letters A - Z. The number of letters is at least 1 and at most 100000.

Output

Two 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 Sample Output Sample

ABRACADABRACAD

2 3