#K57952. Most Frequent Character

    ID: 30534 Type: Default 1000ms 256MiB

Most Frequent Character

Most Frequent Character

You are given a string and your task is to determine the most frequently occurring character in the string. In the event that multiple characters have the same highest occurrence, you should return the lexicographically smallest character.

If the input is an empty string, the output should be an empty string. The input is always provided via standard input (stdin) and the output must be printed to standard output (stdout).

Note: Even though the input is guaranteed to be read from the standard input, if the input is not a valid non-empty string, your program should output an empty string.

The problem can be formally described by the formula:

\( ans = \min\{ c \mid freq(c) = \max_{x \in S} freq(x) \} \)

inputFormat

The input consists of a single line containing a string s. The string may include spaces, punctuation, and special characters. It will be read from standard input.

outputFormat

Output the single character which occurs most frequently in s. In the case of a tie, output the alphabetically (lexicographically) smallest character. If the input is empty or invalid, output an empty string.

## sample
test
t