#K12126. Most Frequent Character

    ID: 23622 Type: Default 1000ms 256MiB

Most Frequent Character

Most Frequent Character

You are given a string s. Your task is to determine the character that occurs the most in the string. In case multiple characters have the same maximum frequency, you should output the lexicographically smallest one.

For example, if the string is abracadabra, the character a appears most frequently so the output should be a. Similarly, for the string mississippi, the answer is i.

The solution involves counting the frequency of each character and then selecting the character with the maximum occurrence. If there is a tie, choose the smallest one by lexicographical order.

inputFormat

The input consists of a single line containing the string s (1 ≤ |s| ≤ 105). The string may contain any printable characters.

outputFormat

Output a single character which is the most frequent character in the string. In case of a tie, output the lexicographically smallest character.

## sample
a
a