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

public class p3 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
        int n = in.nextInt();
        int[] a = new int[n * n];
        for (int i = 0; i < n * n; i++) {
            a[i] = in.nextInt();
            if (hm.get(a[i]) == null) hm.put(a[i], 1);
            else hm.put(a[i], hm.get(a[i]) + 1);
        }
        Arrays.sort(a);
        int[] ans = new int[n];
        int cur = 0;
        for (int i = n * n - 1; i >= 0; i--) {
            if (hm.get(a[i]) > 0) {
                int num = 0;
                int cnt = 0;
                for (int j = 0; j < cur; j++) {
                    if (ans[j] % a[i] == 0) {
                        cnt ++;
                    }
                }
                for (int j = 0; j <= hm.get(a[i]); j++) {
                    if (2 * cnt * j + j * j == hm.get(a[i])) {
                        num = j;
                        break;
                    }
                }
                hm.put(a[i], 0);
                for (int j = 0; j < cur; j++) {
                    int gcd = GCD(a[i], ans[j]);
                    hm.put(gcd, hm.get(gcd) - 2 * num);
                }
                for (int j = 0; j < num; j++) {
                    ans[cur++] = a[i];
                }
            }
        }
        for (int i = 0; i < cur; i++) {
            System.out.print(ans[i] + " ");
        }
        out.close();
    }

    public static int GCD(int a, int b) {
        if (b == 0) return a;
        return GCD(b, a % b);
    }

    static class Pair implements Comparable<Pair> {
        int x;
        int y;

        public Pair(int x, int y) {
            super();
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair p) {
            return x < p.x ? -1 : x > p.x ? 1 : 0;
        }
    }

    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());
        }

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

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

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasMoreElements() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                String s;
                try {
                    s = reader.readLine();
                } catch (IOException e) {
                    return false;
                }
                tokenizer = new StringTokenizer(s);
            }
            return tokenizer.hasMoreElements();
        }
    }
}