#K69572. Longest Word Finder

    ID: 33116 Type: Default 1000ms 256MiB

Longest Word Finder

Longest Word Finder

Given a sentence as input, your task is to find the longest word that contains only alphabetic characters (i.e., letters A-Z and a-z). A word is defined as a contiguous sequence of letters. In case multiple words have the same length, return the one that appears first in the sentence.

If no valid word exists, output an empty string.

Note: Non-alphabetic characters (including punctuation and digits) are considered as delimiters.

Example:
Input: "Python's syntax is simple yet powerful."
Output: "powerful"

inputFormat

The input is provided via standard input (stdin) as a single line containing the sentence.

outputFormat

Output the longest word found in the sentence. If there is no valid word, output an empty string.

## sample
Hello world
Hello