import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;

public class Main 
{
	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read() 
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try 
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() 
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-') 
	        {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do 
	        {
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    private boolean isSpaceChar(int c) 
	    {
	        return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
	    }
	}
	
	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();
	}
}
