def strsort (a):
li=list(a)
li.sort()
a=''.join(li)
return a
while True:
n=int(input())
if n==0:break
li1=raw_input().strip().split()
li2=[]
for i in range(len(li1)):
li2.append(strsort(li1[i]))
for i in range(len(li2)-1,-1,-1):
if li2.count(li2[i])>1:
del li1[i]
if len(li1)==0:
print 'None'
else:
li1=map(int,li1)
li1.sort()
for i in li1:
print i,
print