#Q63. 「一本通 2.4 练习 4」最短母串
「一本通 2.4 练习 4」最短母串
Description
Original source: HNOI 2006
Given strings , find the shortest string such that all strings are substrings of .
Input Format
The first line contains a positive integer , indicating the number of given strings;
The following lines each contain a string composed entirely of uppercase letters.
Output Format
Output only one line, the shortest string found.
If there are multiple strings that satisfy the requirement while being the shortest, the one that comes first in lexicographical order must be output.
Sample 1
2
ABCD
BCDABC
ABCDABC
Data Range and Hint
For all data, .