#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
给你个仅由小写字母组成的字符串,请你找出一种字典序,使得这个字符串在这种字典序下是从小到大排列的.
Input
第一行一个整数,表示有个字符串.
接下来行,每行一个字符串,每个字符串的长度不超过,不含空串.
Output
如果无解,输出.
如果有解,输出一个长度为的字符串,其中第个字母表示这种字典序下第小的字母.
如果有多个解,输出在字典序下最小的那一个.
Samples
10
petr
egor
endagorion
feferivan
ilovetanyaromanova
kostka
dmitriyh
maratsnowbear
bredorjaguarturnik
cgyforever
aghjlnopefikdmbcqrstuvwxyz
Resources
2017 UESTC Training for Graph Theory