Problem: Consider a new order of english alphabets (a to z), that we are not aware of.
What we have though, dictionary of words, ordered according to the new order.

Our task is to give each alphabet a rank, ordered list of words.
The rank of an alphabet is the minimum integer R that can be given to it, such that:

if alphabet Ai has rank Ri and alphabet Aj has Rj, then
Rj > Ri if and only if Aj > Ai
Rj < Ri if and only if Aj < Ai

Points to note:
We only need to find the order of alphabets that are present in the words
There might be some cases where a strict ordering of words cannot be inferred completely, given the limited information. In that case, give the least possible Rank to every alphabet
It can be assumed that there will be no direct or indirect conflict in different inferences got from the input

Input:
First line consists of integer 'W', the number of words. 1 ≤ W ≤ 100
Second line onwards, there are 'W' lines, given ordered list of words. The words will be non-empty, and will be of length ≤ 20 characters. Also all the characters will be lowercase alphabets, a to z

Output:

The alphabets, in order of their Rank, for alphabets with the same rank, print them in the order as we know it today

Examples

1)

Input:
2
ba
ab

Output:
b
a

Explanation: ab comes after ba implies that b < a

2)

Input:
3
abc
aca
ca

Ouput:
ab
c

Explanation: from the first 2 words, we know b < c, and from the last 2 words, we know a < c. We don't have an ordering between a and b, so we give both of them the same rank, and print them in the order as we know today: ab

SAMPLE INPUT
6
aaabc
aaade
bacd
cde
cda
cca

SAMPLE OUTPUT
e
a
b
d
c

Solution (in PYTHON):

Solution:
w=int(raw_input())
s=[]
ord={}
rank={}
for i in xrange(w):
    s1=list(raw_input())
    for i in s1:
        if i not in rank:
            rank[i]=0
            ord[i]=[]
    s+=[s1]
for i in xrange(w):
    for j in xrange(i+1,w):
        for k in xrange(len(s[i])):
            if s[i][k]!=s[j][k]:
                ord[s[i][k]]+=[s[j][k]]
                break
def f(i,r):
    if rank[i]<r:
        rank[i]=r
        for j in ord[i]:
            f(j,r+1)
for i in ord:
    if rank[i]==0: f(i,1)
s=[]
r=1
while(sum(len(i) for i in s)<len(ord)):
    s1=[]
    for i in rank:
        if rank[i]==r:
            s1+=[i]
    s1.sort()
    s+=[s1]
    r+=1
for i in s:
    print ''.join(i)