while True:
n = int(raw_input())
if n == 0:
break;
li = raw_input().strip().split();
lis = []
for i in range(n):
lia = list(li[i]);
lia.sort();
lis.append(int("".join(lia)));
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