#C12647. Most Frequent Alphabetic Character

    ID: 42097 Type: Default 1000ms 256MiB

Most Frequent Alphabetic Character

Most Frequent Alphabetic Character

Given a string, your task is to determine the most frequently occurring alphabetic character(s). The problem ignores spaces, punctuation and digits. Only alphabetic characters are considered, and uppercase and lowercase are treated as identical. If more than one character ties for the highest frequency, output all such characters sorted in alphabetical order.

Note: In this problem, the frequencies are computed by first filtering out non-alphabetic characters and normalizing all letters to lowercase. The answer should be produced as a continuous string of characters without any separators.

For example:

  • For the input "aabbbcc", the output should be "b".
  • For the input "aabbcc", the output should be "abc".

inputFormat

The input consists of a single line of text which may include spaces, punctuation, digits, and other characters. Only alphabetic characters (A-Z and a-z) are relevant and should be considered after converting all letters to lowercase.

outputFormat

Output a string containing the most frequently occurring alphabetic character(s) in the input. In case of a tie, the characters should be output in alphabetical order. If there are no alphabetic characters, output an empty string.

## sample
aabbbcc
b