import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kamrul
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        int findGCD(int number1, int number2) {
            if (number2 == 0) {
                return number1;
            }
            return findGCD(number2, number1 % number2);
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n;
            n = in.nextInt();
            int[] a = new int[n * n];
            TreeMap<Integer, Integer> cnt = new TreeMap<>();
            for (int i = 0; i < n * n; i++) {
                a[i] = in.nextInt();
                if (cnt.get(a[i]) != null) {
                    cnt.put(a[i], cnt.get(a[i]) + 1);
                } else
                    cnt.put(a[i], 1);
                a[i] = -a[i];
            }
            Arrays.sort(a);
            ArrayList<Integer> list = new ArrayList<>();
            for (int i = 0; i < n * n; i++) {
                if (cnt.get(-a[i]) != 0) {
                    boolean flag = true;
                    int gettingPos = -1;
                    for (int j = 0; j < list.size(); j++) {
                        int gcd = findGCD(-a[i], -a[j]);
                        if (cnt.get(gcd) > 1)
                            cnt.put(gcd, cnt.get(gcd) - 2);
                        else {
                            gettingPos = j;
                            flag = false;
                            break;
                        }
                    }
                    if (!flag) {
                        for (int j = 0; j <= gettingPos; j++) {
                            int gcd = findGCD(-a[i], -a[j]);
                            cnt.put(gcd, cnt.get(gcd) + 2);
                        }
                    }
                    if (flag) {
                        list.add(-a[i]);
                        cnt.put(-a[i], cnt.get(-a[i]) - 1);
                    }
                }
            }
            for (int x : list) {
                out.print(x + " ");
            }
            out.println();
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}

