Limits 1s, 512 MB

Given a blob of text you will have to determine the following statistics about it:

  • The longest word.

  • The shortest word.

  • The most repeated word.

If there are multiple words satisfying the same criteria, print the one that appears the earliest in the text. Two words in different letter casing is to be considered the same (.e.g. Hello and hello are the same word). You will have the print the word as it appears for the first time in the text (i.e. maintain the same letter casing).

Input

The input will contain a single line of text. The length of the entire line will not be any longer than 3000 characters. The text will contain A-Z (in both upper and lower cases) and punctuation symbols.

Punctuation can be period (.), comma (,) or semicolon (;). There will be no space before any punctuation. There will be exactly one space after a punctuation if it is not the end of the text and a word appears after it.

There will be at least one word in the input.

Output

Print three words. First the longest word. Then the shortest word. Then the word that was repeated the most. If there are multiple candidates for any of these words, print the one that appears the earliest in the text. Print the word as it appears the first time in the text.

Sample

InputOutput
Ac volutpat sapien augue, nec volutpat sem vehicula donec.
volutpat
Ac
volutpat

Submit

Login to submit.

Statistics

59% Solution Ratio
jahid_hridoyEarliest, Dec '22
user.2599Fastest, 0.0s
Anwar.904531Lightest, 4.9 MB
ShuddhoShortest, 196B
Toph uses cookies. By continuing you agree to our Cookie Policy.