#B2156. Longest Word Finder

    ID: 11238 Type: Default 1000ms 256MiB

Longest Word Finder

Longest Word Finder

Given a simple English sentence that ends with a period (.), where words are separated by a space and there are no abbreviations or special forms, find and output the longest word in the sentence. If there are multiple words with the maximum length, output the first one.

inputFormat

The input consists of a single line representing a sentence. The sentence always ends with a period '.' and the words are separated by a single space.

outputFormat

Output the longest word found in the sentence. In case of ties the first occurring longest word should be output.

sample

Hello world.
Hello