Home => ProblemSet => 4.1-33:Hat’s Words
Problem2158--4.1-33:Hat’s Words

2158: 4.1-33:Hat’s Words

Time Limit: 1 Sec  Memory Limit: 128 MB  Submit: 0  Solved: 2
[ Submit ] [ Status ] [ Creator: ][ 参考程序 ]

Description

A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.
You are to find all the hat’s words in a dictionary.

Input

Standard input consists of a number of lowercase words, one per line, in alphabetical order. There will be no more than 50,000 words.
Only one case.

Output

Your output should contain all the hat’s words, one per line, in alphabetical order.

Sample Input Copy

a
ahat
hat
hatword
hziee
word

Sample Output Copy

ahat
hatword

Source/Category