import java.util.*;

import java.io.*;
public class A582 {
public static void main(String[] args) throws IOException
{
    FS input = new FS(System.in);
    int n = input.nextInt();
    int[] a = new int[n*n];
    for(int i = 0; i<n*n; i++) a[i] = input.nextInt();
    ArrayList<Integer> res = new ArrayList<Integer>();
    TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();
    for(int i = 0; i<n*n; i++) map.put(a[i], map.containsKey(a[i]) ? 1 + map.get(a[i]) : 1);
    for(int i = 0; i<n; i++)
    {
        int cur = map.lastKey();
        map.put(cur, map.get(cur)-1);
        //System.out.println(cur);
        if(map.get(cur) == 0) map.remove(cur);
        for(int x : res)
        {
            int g = gcd(x, cur);
            //System.out.println(g);
            map.put(g, map.get(g) - 2);
            if(map.get(g) == 0) map.remove(g);
        }
        res.add(cur);
    }
    for(int x : res) System.out.print(x+" ");
}
static int gcd(int a, int b)
{
    return b == 0 ? a : gcd(b, a%b);
}
static class FS
{
    BufferedReader br;
    StringTokenizer st;
    public FS(InputStream in)
    {
        br = new BufferedReader(new InputStreamReader(in));
    }
    String next() throws IOException
    {
        while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
    int nextInt() throws IOException
    {
        return Integer.parseInt(next());
    }
}
}
