E. A Word to Trump All
time limit per test
2.5 с
memory limit per test
512 megabytes
input
standard input
output
standard output

Donald Trump is a terrible person. It is said he won't sleep at night until he has unfairly offended someone. Donald knows N horrible words and M kind words. For his next speech, he wants to compress the horrible words together to create the most offensive word of all time, while not saying any kind words.

We say a word s contains a word t if it has the word t as a contiguous substring. Trump wants to find the smallest word that contais all N horrible words he knows, and none of the M kind words. Determine one such word.

Input

On the first two integers N and M. In each of the next N lines, a horrible word. In each of the next M lines, a kind word.

Limits

  • 1 ≤ N + M ≤ 15
  • N ≥ 1, M ≥ 0
  • Each word is a string with at least 1 and at most 300 characters
  • All strings consist of lowercase characters from a to j
  • The sum of lengths of all strings will not exceed 300
Output

If there is no such word, print only "-" in a single line. Otherwise, print a single string, an answer to the problem. It can only contain lowercase characters from a to j. If there are multiple possible strings, print any of them.

Examples
Input
3 0
hejja
gecab
jag
Output
hejjagecab
Input
3 1
ababab
bababb
abbb
babbb
Output
abbbabababb