import java.io.*;
import java.util.*;

public class A_GCD_Table {

    public static void main(String[] args)throws Exception {
        FastReader in = new FastReader();
        int n = in.nextInt();
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
        ArrayList<Integer> list = new ArrayList<Integer>();
        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n * n; i++) {
            int x = in.nextInt();
            if (map.containsKey(x)) {
                map.put(x, map.get(x) + 1);
            } else {
                map.put(x, 1);
                list.add(x);
            }
        }

        Collections.sort(list);

        ArrayList<Integer> ans = new ArrayList<Integer>();
        for (int i = list.size() - 1; i >= 0;) {
            int a = list.get(i);
            if (map.get(a) == 0) {
                i--;
                continue;
            }
            map.put(a, map.get(a) - 1);
            for (Integer x : ans) {
                int y = gcd(x, a);
                map.put(y, map.get(y) - 2);
            }
            ans.add(a);
        }
        for (Integer x : ans) {
            out.append(x + " ");
        }
        out.deleteCharAt(out.length()-1);
        out.append("\n");
        System.out.print(out);

    }

    static int gcd(int x, int y) {
        if (x == 0) {
            return y;
        }
        return gcd(y % x, x);
    }


static class FastReader {

    BufferedReader br;
    StringTokenizer st;

    FastReader() { // To read from the standard input
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    // You can add a constructor to read from a file
    /////

    String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    //You can add nextDouble() etc...   

    boolean hasNext() throws IOException { // if input is terminated by EOF
        String s = br.readLine();
        if (s == null) {
            return false;
        }
        st = new StringTokenizer(s);
        return true;
    }
} //end FastReader

}