Recently you invented a brand-new definition of prime numbers. For a given set of positive integers S let's call X a prime if there are no elements in S which are divisors of X (except  X itself).

You are given a set S. Find elements in it which are prime numbers for this set.

Input
The first line contains one integer N - size of the set S.
The second line contains N space-separated integers - elements of S. All the numbers are pairwise different.

Output
Output one line: elements of S which are prime numbers for this set in the order they occur in the input. Separate them by whitespaces.

Constraints
N ≤ 100
1 ≤ S[i] ≤ 10^6 (1 ≤ i ≤ n)

SAMPLE INPUT
5
10 5 3 15 16

SAMPLE OUTPUT
 5 3 16
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
#let my set of number is in a list s.
s = []
prime_list = s
output = []
item = raw_input()
maxLengthList = int(item)
item1 = raw_input()
#item1 = input("")
s = item1.split(' ')
s= map(int,s)
for x in s:
   for p in s:
     if x != p:
   	  if x%p == 0:
   	  	#prime_list.remove(x)
   	  	prime_list.append(x)
   	  	break
#print prime_list
for x in s:
    if x not in prime_list:
    	print x,