Start: Apr, 17, 2017 11:00:00
Python程序设计基础培训第五次作业
End: Apr, 23, 2017 15:00:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 92ms
Memory: 21432kB
Author: 13706505702
In contest: 1089

def sortstr(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(sortstr(li1[i]))
	
	for i in range(len(li1)-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