#C12670. Most Frequent Word

    ID: 42123 Type: Default 1000ms 256MiB

Most Frequent Word

Most Frequent Word

You are given a text consisting of letters, spaces, and punctuation. Your task is to find the alphabetic word that appears most frequently in the given text. Only sequences of letters (a–z or A–Z) are considered words. In case of ties, you may output any one of the most frequent words.

If the input text is empty or does not contain any alphabetic word, output an empty string.

Note: When counting frequencies, the matching is case‑insensitive (i.e. all words are considered in lowercase).

LaTeX formula (example): \(\text{frequency}(w) = \sum_{i=1}^{n} \mathbb{1}_{\{w_i = w\}}\)

inputFormat

The input is provided via stdin and consists of a single text. The text can be empty or include spaces, letters, and punctuation marks. Consider the entire input as one string.

outputFormat

Output the most frequent word (in lowercase) to stdout. If the input text is empty or if there is no alphabetic word, output an empty string. In case there are multiple words with the maximum frequency, output any one of them.

## sample
the quick brown fox jumps over the lazy dog the fox was quick
the