
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;


public class GCDTable {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int[] arr = new int[n*n];
		for(int i=0;i<n*n;i++)
				arr[i] = sc.nextInt();
		shuffle(arr);
		Arrays.sort(arr);
//		System.out.println(Arrays.toString(arr));
		TreeMap<Integer, Integer> map = new TreeMap<>();
		for(int i=n*n-1;i>=0;i--)
		{
			int cur = arr[i];
			if(map.containsKey(cur) && map.get(cur) > 0)
				map.put(cur, map.get(cur)-1);
			else
			{
				pw.print(cur +" ");
				for(int j=i+1;j<n*n;j++)
				{
					int gcd = gcd(cur,arr[j]);
					if(!map.containsKey(gcd))
						map.put(gcd,2);
					else
						map.put(gcd, map.get(gcd)+2);
				}
			}
		}
		pw.flush();
		pw.close();
	}
	
	static int gcd(int x, int y){
		if(y == 0)
			return x;
		return gcd(y,x%y);
	}
	
	static void shuffle(int [] a){
		Random r=new Random();
		for(int i=0;i<a.length;i++){
			int j=r.nextInt(a.length);
			int tmp=a[i];
			a[i]=a[j];
			a[j]=tmp;
		}
	}
	
	static class Scanner{
		StringTokenizer st;BufferedReader br;
		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}
		public String next() throws IOException 
		{while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());return st.nextToken();}
		public int nextInt() throws IOException {return Integer.parseInt(next());}
		public long nextLong() throws IOException {return Long.parseLong(next());}
		public String nextLine() throws IOException {return br.readLine();}
		public double nextDouble() throws IOException {return Double.parseDouble(next());}
		public boolean ready() throws IOException {return br.ready();}
	}
}
