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.
Input
aaaabbbccd edcba zazaz zaza
Output
b b a z