import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;


public class A {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        Integer[]B = new Integer[n*n];
        int[]b = new int[n*n];
        int m = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                B[m++] = nextInt();
            }
        }
        Arrays.sort(B);
        for (int i = 0; i < m; i++) {
            b[i] = B[m-1-i].intValue();
        }
        Map<Integer, Integer> map = new TreeMap<>();
        int cnt = 0;
        int[]a = new int[n+1];
        for (int i = 0; i < m; i++) {
            if (map.containsKey(b[i]) && map.get(b[i]).intValue() > 0) {
                map.put(b[i], map.get(b[i])-1);
            }
            else {
                pw.print(b[i]+" ");
                cnt++;
                a[cnt] = b[i];
                for (int j = 1; j < cnt; j++) {
                    int g = gcd(a[cnt], a[j]);
                    if (!map.containsKey(g))
                        map.put(g, 2);
                    else
                        map.put(g, map.get(g)+2);
                }
            }
            if (cnt==n)
                break;
        }
        pw.close();
    }
    private static int gcd(int a, int b) {
        if (b==0)
            return a;
        return gcd(b, a % b);
    }
    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}
