OpenKattis
Extrauppgifter [converted from problem group]

Start

2020-03-18 16:00 AKDT

Extrauppgifter [converted from problem group]

End

2021-03-18 16:00 AKDT
The end is near!
Session is over.
Not yet started.
Session is starting in -798 days 17:22:43

Time elapsed

8760:00:00

Time remaining

0:00:00

Problem B
Compound Words

Write a program that reads a list of words from standard input and prints out a sorted list of all unique compound words that can be made by concatenating two different words from the input list. If the same compound word can be formed more than one way, it should only be listed once in the output.

Input

Input is a list of $1$ to $100$ words separated by whitespace (spaces and / or newlines). There may be more than one word on each input line. Each word is a sequence of at most $10$ lowercase English letters (a–z). Input ends at end of file.

Output

Your program should print out all unique compound words, one per line. They should be printed in sorted (dictionary) order.

Sample Input 1 Sample Output 1
a bb
ab b
aab
ab
aba
abb
abbb
ba
bab
bba
bbab
bbb