URI Online Judge | 2138

Most Frequent Digit

By Joao Marcos Salvanini Bellini de Moraes, IFSULDEMINAS BR Brazil

Timelimit: 1

In Nlogonia, several programmers participate in a cryptography competition named "Decrypt it!", in which the one who decrypt more messages wins.

In the middle of the competition, you notice that to continue and decrypt a message, you must solve the following challenge: find the most frequent digit of a number with up to 1001 digits.

Input

The input consists of several lines, containing an integer N (1 ≤ N ≤ 101000). Read input until EOF.

Output

Print the most frequent digit of the given number. If there's more than one, print the greatest one among them.

Input Sample Output Sample

3981152060

1508442812980080428167730232746481

1

8