import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Main 
{
	class MyScanner
	{
		private StringTokenizer tk;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    
		public int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }

	    public String next() throws IOException 
	    {
	        if (null == tk || !tk.hasMoreTokens()) 
	        {
	            tk = new StringTokenizer(br.readLine());
	        }
	        return tk.nextToken();
	    }
	}
	
	public int gcd(int x, int y)
	{
		if(0 == y)
		{
			return x;
		}
		else 
		{
			return gcd(y, x % y);
		}
	}
	
	public void foo() throws IOException
	{
		MyScanner scan = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int m = n * n;
		int[] a = new int[m];
		HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
		int x = 0;
		for(int i = 0;i < m;++i)
		{
			x = scan.nextInt();
			a[i] = x;
			if(hm.containsKey(x))
			{
				hm.put(x, hm.get(x) + 1);
			}
			else
			{
				hm.put(x, 1);
			}
		}
		Arrays.sort(a);
		StringBuilder s = new StringBuilder();
		ArrayList<Integer> arr = new ArrayList<Integer>();
		
		for(int i = m - 1;i >= 0;--i)
		{
			x = a[i];
			if(0 == hm.get(x))
			{
				continue;
			}
			s.append(x + " ");
			hm.put(x, hm.get(x) - 1);
			for(Integer j : arr)
			{
				int y = gcd(j, x);
				hm.put(y, hm.get(y) - 2);
			}
			arr.add(x);
		}
		
		out.println(s.toString().trim());
		out.close();
	} 
	
	public static void main(String[] args) throws IOException
	{
		new Main().foo();
	}
}
