while True:
n = int(raw_input())
if n == 0:
break
li = raw_input().strip().split()
lis = []
for v in li:
v = list(v)
v.sort()
lis.append(int("".join(v)))
lic = []
lid = map(int,li)
for i in range(n):
if(lis.count(lis[i]) == 1):
lic.append(lid[i])
if len(lic) == 0:
print "None"
else:
lic.sort()
for v in lic:
print v,
print