Limits 1s, 512 MB

Given a line of text (space-separated words), find the first word that appears at least twice in the text.

Input

The input will contain a line of text of at most 1000 characters. The text will contain upper and lowercase English alphabets and spaces.

There will be at least one word in the text that appears at least twice.

Output

Output the first word appears at least twice in the input text. You may output the word in any letter case.

Sample

InputOutput
The quick brown fox jumps over the lazy dog
the

Submit

Login to submit.

Statistics

0% Solution Ratio
Toph uses cookies. By continuing you agree to our Cookie Policy.