import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class GCD_Table {
    public static int gcd(int a,int b){
        return b==0 ? a:gcd(b, a%b);
    }
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(in.readLine().trim());
        TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>(Collections.reverseOrder());
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n * n; i++) {
            int ele = Integer.parseInt(st.nextToken());
            if (map.containsKey(ele)) {
                map.put(ele, map.get(ele) + 1);
            } else {
                map.put(ele, 1);
            }
        }
        
        Iterator<Map.Entry<Integer, Integer>> it = map.entrySet().iterator();
        ArrayList<Integer> res = new ArrayList<Integer>();
        while (it.hasNext()) {

            Map.Entry<Integer, Integer> pair = (Map.Entry<Integer, Integer>) it.next();
            while(pair.getValue()>0){
                for(int i = 0;i< res.size();i++){
                    int ele = gcd(pair.getKey(),res.get(i));
                    map.put(ele,map.get(ele)-2);
                }
                pair.setValue(pair.getValue()-1);
                res.add(pair.getKey());
            }
        }
        for(int i = 0;i<res.size();i++)
            out.print(res.get(i)+" ");
        in.close();
        out.close();
    }
}
