import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public class GCD {

    public static void main(String[] args) throws Exception {
        // TODO Auto-generated method stub
        BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
        int  n=Integer.parseInt(br.readLine());
        String[] parts=br.readLine().split(" ");
        HashMap<Integer,Integer> m  =new HashMap<Integer,Integer>();
        ArrayList<Integer> a = new ArrayList<Integer>();
        ArrayList<Integer> save = new ArrayList<Integer>();
        StringBuilder sb = new StringBuilder();

        int number,gcd;
        for(int i = 0; i < n*n; i++){
 number=Integer.parseInt(parts[i]);
if(m.containsKey(number))
    m.put(number, m.get(number)+1);
else
    m.put(number, 1);
a.add(number);
        }
        Collections.sort(a);
        for(int i=a.size()-1;i >=0;i--){
            number=a.get(i);
            if(m.get(number)==0)
                continue;
            for(int j:save){
                gcd=gcd(j,number);
                m.put(gcd, m.get(gcd)-2);
            }
            save.add(number);
            m.put(number, m.get(number)-1);
            sb.append(number);
            sb.append(" ");
        }
System.out.println(sb.toString());
br.close();
    }
    public static int gcd (int a,int b)
    {
    if(b==0)return a;
    return gcd(b,a%b);
    }
}
