#Lutece1635. 琵琶弦上说相思,当时明月在,曾照彩云归

琵琶弦上说相思,当时明月在,曾照彩云归

Migrated from Lutece 1635 琵琶弦上说相思,当时明月在,曾照彩云归

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给你nn个仅由小写字母组成的字符串,请你找出一种字典序,使得这nn个字符串在这种字典序下是从小到大排列的.

Input

第一行一个整数n(1n1000)n\left (1 \leq n \leq 1000 \right ),表示有nn个字符串.
接下来nn行,每行一个字符串,每个字符串的长度不超过200200,不含空串.

Output

如果无解,输出1-1.
如果有解,输出一个长度为2626的字符串,其中第ii个字母表示这种字典序下第ii小的字母.
如果有多个解,输出在字典序"abcdefghijklmnopqrstuvwxyz""abcdefghijklmnopqrstuvwxyz"下最小的那一个.

Samples

10
petr
egor
endagorion
feferivan
ilovetanyaromanova
kostka
dmitriyh
maratsnowbear
bredorjaguarturnik
cgyforever
aghjlnopefikdmbcqrstuvwxyz

Resources

2017 UESTC Training for Graph Theory