import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class A {

    
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        int n = sc.nextInt();
        int[] a = new int[n * n];
        for(int i = 0; i < n * n; ++i)
            a[i] = sc.nextInt();
        Arrays.sort(a);
        ArrayList<Integer> b = new ArrayList<Integer>(n);
        TreeMap<Integer, Integer> c = new TreeMap<Integer, Integer>();
        for(int i = n * n - 1; i >= 0; --i)
        {
            int e = a[i];
            Integer f = c.get(e);
            if(f != null)
                if(f == 0)
                    c.remove(e);
                else
                    c.put(e, f - 1);
            else
            {
                for(int d : b)
                {
                    int gcd = gcd(e, d);
                    f = c.get(gcd);
                    if(f == null)
                        f = 0;
                    c.put(gcd, f + 1);
                }
                b.add(e);
            }
            
        }
        for(int i = 0; i < n - 1; ++i)
            out.format("%d ", b.get(i));
        out.format("%d\n", b.get(n - 1));
        out.flush();
        out.close();
    }
    
    static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a%b); }
    
    static class Scanner 
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader fileReader) throws FileNotFoundException{ br = new BufferedReader(fileReader);}

        public Scanner(InputStream s) throws FileNotFoundException{ br = new BufferedReader(new InputStreamReader(s));}

        public String next() throws IOException 
        {
            while (st == null || !st.hasMoreTokens()) 
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public double nextDouble() throws IOException
        {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if(x.charAt(0) == '-')
            {
                neg = true;
                start++;
            }
            for(int i = start; i < x.length(); i++)
                if(x.charAt(i) == '.')
                {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                }
                else
                {
                    sb.append(x.charAt(i));
                    if(dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg?-1:1);
        }


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

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

        public String nextLine() throws IOException {return br.readLine();}

        public boolean ready() throws IOException {return br.ready(); }


    }

}