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


public class A {

    int gcd(int x,int y){
        if(x==0)return y;
        return gcd(y%x,x);
    }

    void solve() throws IOException {
        int n=nextInt();
        HashMap<Integer,Integer> s=new HashMap<Integer, Integer>();
        ArrayList<Integer> a=new ArrayList<Integer>();
        for(int i=0;i<n*n;i++){
            int x=nextInt();
            if(s.containsKey(x)){
                s.put(x,s.get(x)+1);
            }
            else{
                s.put(x,1);
                a.add(x);
            }
        }

        Collections.sort(a);

        ArrayList<Integer> result=new ArrayList<Integer>();
        for(int i=a.size()-1;i>=0;){
            int cur=a.get(i);
            if(s.get(cur)==0){
                i--;
                continue;
            }
            s.put(cur,s.get(cur)-1);
            for(Integer x:result){
                int y=gcd(x,cur);
                s.put(y,s.get(y)-2);
            }
            result.add(cur);
        }
        for(Integer x:result)
            out.print(x+" ");

    }

    public static void main(String[] args) throws IOException {
        new A().run();
    }

    void run() throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
//      reader = new BufferedReader(new FileReader("input.txt"));
        tokenizer = null;
        out = new PrintWriter(new OutputStreamWriter(System.out));
//      out = new PrintWriter(new FileWriter("output.txt"));
        solve();
        reader.close();
        out.flush();

    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}