import java.util.*;
import java.io.*;
import java.math.*;
public class Class{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        StringTokenizer st = new StringTokenizer(br.readLine());
        TreeMap<Integer, Integer> treemap = new TreeMap<Integer, Integer>();
        for(int i=0; i<n*n; i++){
            int j = Integer.parseInt(st.nextToken());
            if(treemap.containsKey(j))treemap.put(j, treemap.get(j)+1);
            else treemap.put(j, 1);
        }
        Set set = treemap.entrySet();
        //Iterator it = set.iterator();
        int i = n-1;
        int[] a = new int[n];
        while(treemap.size()!=0){
            Map.Entry<Integer, Integer> entry = treemap.lastEntry();
            a[i] = entry.getKey();
            System.out.print(a[i]+" ");
            for(int j=i; j<n; j++){
                int gcd = gcd(a[i],a[j]);
                int k = treemap.get(gcd);
                if(k==2||k==1)treemap.remove(gcd);
                else if(j==i)treemap.put(gcd, k-1);
                else treemap.put(gcd, k-2);
            }
            i--;
        }
     }
    
    public static int gcd(int a, int b){
        if(b>a){int temp = a; a = b; b = temp;}//a is greater
        if(a%b==0)return b;
        return gcd(b, a%b);
    }
    static class Pair{
        long start;
        long end;
        
        public Pair(long start, long end){
            this.start = start;
            this.end = end;
        }
        
        public int hashCode() {
            return (int)(this.start + this.end);
        }
        
        public boolean equals(Object p){
            if(((Pair)p).start==this.start && ((Pair)p).end==this.end)return true;
            return false;
        }
    }
}