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

public class A implements Runnable {
    private static BufferedReader in;
    private static PrintWriter out;
    private static StringTokenizer st;
    private static Random rnd;

    private void solve() throws IOException {
        int numbersCount = nextInt();
        long[] values = new long[numbersCount * numbersCount];
        for (int i = 0; i < numbersCount * numbersCount; i++)
            values[i] = nextLong();
        Arrays.sort(values);
        if (numbersCount == 1) {
            out.println(values[0]);
        } else {
            Map<Long, Integer> count = new TreeMap<>();
            for (long value : values) {
                Integer before = count.get(value);
                count.put(value, (before == null ? 0 : before) + 1);
            }
            List<Long> taken = new ArrayList<>();
            for (int i = numbersCount * numbersCount - 1; i >= 0; i--) {
                long value = values[i];
                Integer remain = count.get(value);
                if (remain > 0) {
                    removeValue(count, value);
                    for (long before : taken) {
                        long gcd = GCD(before, value);
                        removeValue(count, gcd);
                        removeValue(count, gcd);
                    }
                    taken.add(value);
                }
            }
            if (taken.size() != numbersCount)
                throw new AssertionError();
            for (long x : taken)
                out.print(x + " ");
        }
    }

    private void removeValue(Map<Long, Integer> count, long v) {
        Integer before = count.get(v);
        if (before <= 0)
            throw new AssertionError();
        count.put(v, before - 1);
    }

    private long LCM(long a, long b) {
        return (a * b) / GCD(a, b);
    }

    private long GCD(long a, long b) {
        return (b == 0 ? a : GCD(b, a % b));
    }

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

    public void run() {
        final String className = this.getClass().getName().toLowerCase();

        try {
            try {
                in = new BufferedReader(new FileReader(className + ".in"));
                out = new PrintWriter(new FileWriter(className + ".out"));
            } catch (FileNotFoundException e) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            }

            rnd = new Random();

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    private String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();

            if (line == null)
                return null;

            st = new StringTokenizer(line);
        }

        return st.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}