Palindrome#8505

Palindrome

1 second
128 megabytes
Hard

You are given words. Find the shortest palindrome (a word that is the same with its reverse) containing all of them as contiguous substrings.

Input

The first line contains an integer (1 \leq n \leq 14). The next lines contain one word each, between and characters long. All the characters are small English letters through .

Output

Output the required palindrome. If there're several possible solutions, output any.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading