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

public class Solution {

    static class Cmp implements Comparator<Integer> {

        @Override
        public int compare(Integer t, Integer t1) {
            return t1 - t;
        }

    }

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

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n;
        n = scan.nextInt();
        Cmp cmp = new Cmp();
        PriorityQueue<Integer> q = new PriorityQueue<Integer>(n * n, cmp);
        for (int i = 0; i < n * n; i++) {
            int tmp;
            tmp = scan.nextInt();
            q.add(Integer.valueOf(tmp));
        }
        int ans[] = new int[n + 1];
        int cnt = 0;
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        while (!q.isEmpty()) {
            int tmp = q.poll();
            if (map.containsKey(Integer.valueOf(tmp))) {
                int t = map.get(Integer.valueOf(tmp));
                if (t == 1) {
                    map.remove(Integer.valueOf(tmp));
                } else {
                    map.put(Integer.valueOf(tmp), t - 1);
                }
            } else {
                ans[cnt++] = tmp;
                for (int i = 0; i < cnt - 1; i++) {
                    int g = gcd(ans[i], tmp);
                    if (map.containsKey(Integer.valueOf(g))) {
                        int t = map.get(Integer.valueOf(g));
                        map.put(Integer.valueOf(g), t + 2);
                    }
                    else{
                        map.put(Integer.valueOf(g), 2);
                    }
                }
            }
        }
        for(int i = 0 ; i < cnt ; i++){
            if(i > 0) System.out.print(" ");
            System.out.print(ans[i]);
        }
        System.out.print("\n");
    }

}
