import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class A extends PrintWriter {

    int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    void run() {
        int n = nextInt();
        int m = n * n;

        int[] a = nextArray(m);

        for (int i = 0; i < m; i++) {
            int j = rnd.nextInt(i + 1);

            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }

        Arrays.sort(a);

        int k = 1;
        for (int i = 1; i < m; i++) {
            if (a[i - 1] != a[i]) {
                ++k;
            }
        }

        int[] d = new int[k], cnt = new int[k];

        int last = 0;

        for (int i = 0, p = -1; i < m; i++) {
            if (a[i] != last) {
                ++p;
            }

            d[p] = a[i];
            ++cnt[p];

            last = a[i];
        }

//      println(Arrays.toString(d));
//      println(Arrays.toString(cnt));

        int[] ans = new int[n];

        for (int i = 0, p = k - 1; i < n; i++) {
            while (cnt[p] == 0) {
                --p;
            }

            ans[i] = d[p];
            --cnt[p];

            for (int j = 0; j < i; j++) {
                int g = gcd(ans[i], ans[j]);
                int q = Arrays.binarySearch(d, g);
                cnt[q] -= 2;
            }
        }

        for (int i = 0; i < n; i++) {
            print(ans[i]);
            print(' ');
        }

    }

    void skip() {
        while (hasNext()) {
            next();
        }
    }

    int[][] nextMatrix(int n, int m) {
        int[][] matrix = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                matrix[i][j] = nextInt();
        return matrix;
    }

    String next() {
        while (!tokenizer.hasMoreTokens())
            tokenizer = new StringTokenizer(nextLine());
        return tokenizer.nextToken();
    }

    boolean hasNext() {
        while (!tokenizer.hasMoreTokens()) {
            String line = nextLine();
            if (line == null) {
                return false;
            }
            tokenizer = new StringTokenizer(line);
        }
        return true;
    }

    int[] nextArray(int n) {
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = nextInt();
        }
        return array;
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException err) {
            return null;
        }
    }

    public A(OutputStream outputStream) {
        super(outputStream);
    }

    static BufferedReader reader;
    static StringTokenizer tokenizer = new StringTokenizer("");
    static Random rnd = new Random();
    static boolean OJ;

    public static void main(String[] args) throws IOException {
        OJ = System.getProperty("ONLINE_JUDGE") != null;
        A solution = new A(System.out);
        if (OJ) {
            reader = new BufferedReader(new InputStreamReader(System.in));
            solution.run();
        } else {
            reader = new BufferedReader(new FileReader(new File(A.class.getName() + ".txt")));
            long timeout = System.currentTimeMillis();
            while (solution.hasNext()) {
                solution.run();
                solution.println();
                solution.println("----------------------------------");
            }
            solution.println("time: " + (System.currentTimeMillis() - timeout));
        }
        solution.close();
        reader.close();
    }
}