import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.StringTokenizer;
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 robert nabil
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastScanner sc, PrintWriter writer) {
            int n = sc.nextInt();
            MyPrioryQueue q = new MyPrioryQueue();

            for (int i = 0; i < n * n; i++) {
                q.add(sc.nextInt());
            }

            ArrayList<Integer> res = new ArrayList<>();
            res.add(q.poll());
            for (int i = 1; i < n; i++) {
                res.add(q.poll());
                for (int j = 0; j < res.size() - 1; j++) {
                    int t = gcd(res.get(j), res.get(res.size() - 1));
                    q.remove(t);
                    q.remove(t);
                }
            }

            for (int i : res)
                writer.print(i + " ");
        }

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

        class MyPrioryQueue {
            TreeMap<Integer, Integer> m = new TreeMap<>();

            int poll() {
                int res = m.lastKey();
                remove(m.lastKey());
                return res;
            }

            void add(int e) {
                if (!m.containsKey(e))
                    m.put(e, 0);
                m.put(e, m.get(e) + 1);
            }

            void remove(int e) {
                m.put(e, m.get(e) - 1);
                if (m.get(e) <= 0)
                    m.remove(e);
            }

        }

    }

    static class FastScanner {
        BufferedReader r;
        StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            r = new BufferedReader(new InputStreamReader(in));
            tokenizer = new StringTokenizer("");
        }

        public String next() {
            while (!tokenizer.hasMoreTokens())
                try {
                    tokenizer = new StringTokenizer(r.readLine());
                } catch (Exception e) {
                    return null;
                }
            return tokenizer.nextToken();
        }

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

    }
}
