import java.util.*;
import java.io.*;
import java.math.BigInteger;
/*
1 4
DIMA
1


5 5
DIMAD
XMAXI
XIXXM
XDXXA
XAMID

3 4
DIMA
DIMA
AMID
 */
public class A 
{
	public static void main(String[] arg) throws Exception
	{
		new A();
	}
	public A() throws Exception
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		TreeMap<Integer, Integer> tm = new TreeMap<Integer, Integer>();
		for(int i = 0; i < n*n; i++)
		{
			int v = in.nextInt();
			if(!tm.containsKey(v)) tm.put(v, 0);
			tm.put(v, tm.get(v)+1);
		}
		ArrayList<Integer> ans = new ArrayList<Integer>();
		while(tm.size() > 0)
		{
			int best = tm.lastKey();
			ans.add(best);
			//System.out.println(ans.toString());
			for(int i = 0; i < ans.size()-1; i++)
			{
				int g = gcd(ans.get(i), ans.get(ans.size()-1));
				//System.out.println(g);
				tm.put(g, tm.get(g)-2);
				if(tm.get(g) == 0) tm.remove(g);
			}
			tm.put(best, tm.get(best)-1);
			if(tm.get(best) == 0) tm.remove(best);
		}
		for(int v : ans) out.print(v + " ");
		in.close(); out.close();
	}
	int gcd(int a, int b)
	{
		return b == 0?a:gcd(b, a%b);
	}
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
}
