import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.HashMap;
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
 */
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 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            HashMap<Integer, Integer> s = new HashMap<Integer, Integer>();
            int n = in.nextInt();
            for (int i = 1; i <= n * n; i++) {
                int key = in.nextInt();
                int val = s.getOrDefault(key, 0);
                s.put(key, val + 1);
            }
            ArrayList<Integer> ans = new ArrayList<>();
            while (!s.isEmpty()) {
                int max = 0;
                for (Integer el : s.keySet()) {
                    if (el > max)
                        max = el;
                }

                int val = s.getOrDefault(max, 0) - 1;
                if (val == 0)
                    s.remove(max);
                else
                    s.put(max, val);
                for (Integer el : ans) {
                    int g = gcd(max, el);
                    val = s.getOrDefault(g, 0) - 2;
                    if (val == 0)
                        s.remove(g);
                    else
                        s.put(g, val);
                }
                ans.add(max);
            }
            for (int i = 0; i < n; i++) {
                out.print(ans.get(i) + " ");
            }
        }

        int gcd(int a, int b) {
            while (b != 0) {
                int t = a % b;
                a = b;
                b = t;
            }
            return a;
        }

    }

    static class InputReader {
        StringTokenizer st;
        BufferedReader br;

        public InputReader(InputStream is) {
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            this.br = br;
        }

        public String next() {
            if (st == null || !st.hasMoreTokens()) {
                String nextLine = null;
                try {
                    nextLine = br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (nextLine == null)
                    return null;
                st = new StringTokenizer(nextLine);
            }
            return st.nextToken();
        }

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

    }
}

