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

public class A {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

	void solve() throws IOException {
        int n = readInt();
        int[] a = readArr(n*n);
        Arrays.sort(a);
        for(int i = 0, j = n * n - 1; i < n * n / 2; i++, j--) {
            int tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }
        boolean[] used = new boolean[n*n];
        List<Integer> res = new ArrayList<Integer>();

        TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();
        for(int i = 0; i < n * n; i++) {
            if(map.containsKey(a[i])) {
                map.put(a[i], map.get(a[i]) + 1);
            } else {
                map.put(a[i], 1);
            }
        }

        for(int i = 0; i < n; i++) {
            int cur = map.lastKey();
            if(map.get(cur) == 1) {
                map.remove(cur);
            } else {
                map.put(cur, map.get(cur) - 1);
            }
            for(int prev: res) {
                int gcd = gcd(prev, cur);
                if(map.get(gcd) == 2) {
                    map.remove(gcd);
                } else {
                    map.put(gcd, map.get(gcd) - 2);
                }
            }
            res.add(cur);
        }
        for(int i: res) {
            out.print(i + " ");
        }
    }


    int gcd(int a, int b) {
        if(a == 0) return b;
        if(b == 0) return a;
        if(a < b) return gcd(a, b % a);
        return gcd(b, a % b);
    }


    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    int[] readArr(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readArrL(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = readLong();
        }
        return res;
    }

    public static void main(String[] args) {
        new A().run();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }
}