Second most frequent letter

Which is the second most frequent letter in a given word?

Input

Input consists of cases, each case being a word formed only by lower-case letters; each word comes in a line. The word has at least two different letters.

Output

For each word, your program must print the second most frequent letter. All ties are to be resolved in favor of the alphabetically smallest letter.

Problem information

Author: Unknown
Translator: Jose Luis Balcazar

Generation: 2026-01-25T11:34:11.366Z

© Jutge.org, 2006–2026.
https://jutge.org