#C11866. Longest Word Finder

    ID: 41229 Type: Default 1000ms 256MiB

Longest Word Finder

Longest Word Finder

You are given a sentence. Your task is to find and output the longest word in the sentence. In case there are multiple words with the same maximum length, you should output the first occurrence. If the sentence is empty, output an empty string.

The problem tests your ability to manipulate strings and process input from stdin and output the result to stdout.

inputFormat

The input consists of a single line containing a sentence. The sentence may contain letters, spaces, and punctuation. It is read from stdin.

outputFormat

Output the longest word from the given sentence. If several words share the maximum length, output the first one encountered.## sample

The quick brown fox jumps over the lazy dog
quick