n = int(raw_input())
gcd = [int(x) for x in raw_input().split()]
gcd_sorted = sorted(gcd, reverse=True)
gcd_sorted.append(-1)
print gcd_sorted
k = 1;
for i in range(1, n+1):
	if gcd_sorted[i] != gcd_sorted[i-1]:
		if k%2 == 1:
			print gcd_sorted[i-1],
		k = 1
	else:
		k+=1





#nums = [0 for i in range[k]]
def first_attempt():
	for i in range(n):
		print gcd_sorted[i],
	




	
