import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.*;

public class CFC {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    final long MOD = 1000L * 1000L * 1000L + 7;

    void solve() throws IOException {
        int n = nextInt();
        int[] arr = nextIntArr(n * n);
        Map<Integer, Integer> hm = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n * n; i++) {
            hm.put(arr[i], hm.getOrDefault(arr[i], 0) + 1);
            max = Math.max(max, arr[i]);
        }

        List<Integer> res = new ArrayList<>();
        res.add(max);
        hm.put(max, hm.getOrDefault(max, 0) - 1);
        for (int i = 0; i < n - 1; i++) {
            int tmp = 0;
            for (Map.Entry<Integer, Integer> entry : hm.entrySet()) {
                if (entry.getValue() != 0) {
                    tmp = Math.max(tmp, entry.getKey());
                }
            }

            for (int j = 0; j < res.size(); j++) {
                int g = gcd(res.get(j), tmp);
                hm.put(g, hm.getOrDefault(g, 0) - 2);
            }
            hm.put(tmp, hm.getOrDefault(tmp, 0) - 1);

            res.add(tmp);
        }

        for (int i = 0; i < res.size(); i++) {
            out(res.get(i) + " ");
        }
    }

    int gcd(int a, int b) {
        while(a != 0 && b != 0) {
            int c = b;
            b = a % b;
            a = c;
        }
        return a + b;
    }
    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    public CFC() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new CFC();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}