#K14261. Longest Word Finder

    ID: 24096 Type: Default 1000ms 256MiB

Longest Word Finder

Longest Word Finder

Given a string of text, your task is to extract the longest word from it. A word is defined as a continuous sequence of alphabetical characters (i.e. matching the regular expression [A-Za-z]+). Formally, you can say that a word \(w\) in a text \(t\) is a substring where every character \(c\) in \(w\) satisfies \(c \in \{a, b, \ldots, z, A, B, \ldots, Z\}\).

If two or more words share the maximum length, the first occurrence should be output.

inputFormat

The input consists of a single line containing a string \(S\) which may include letters, digits, punctuation marks, and spaces.

outputFormat

Output the longest word extracted from the input. In case of ties, output the first word with the maximum length.

## sample
The quick brown fox.
quick