Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/eng-kop-uchragan-harf

Most frequent letter

Easy 1000 ms 64 MB 30%
Share

A string $s$ of lowercase Latin letters is given. Find the letter that occurs in it most often and the number of its occurrences. If several letters are tied, take the one that comes first in the alphabet.

Comparing letter frequencies and finding the largest

Input

One line containing the string $s$.

Output

One line with the letter and its count separated by a space.

Note

$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters (a–z) only

Examples

Input #1
algoritm
Output #1
a 1
Input #2
banana
Output #2
a 3

Sign in to submit a solution

Signing up is free and takes a minute.