import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class A {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        int[][] a = new int[n][n];
        // Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); 
        // int n = Integer.parseInt(bf.readLine());
        StringTokenizer st = new StringTokenizer(bf.readLine());
        PriorityQueue<Integer> vals = new PriorityQueue<Integer>(n*n, Collections.reverseOrder());
        Map<Integer, Integer> dontcount = new HashMap<Integer, Integer>();
        
        
         for(int i=0; i<n; i++) {
             for(int j=0; j<n; j++) {
                 a[i][j] = Integer.parseInt(st.nextToken());
                 vals.add(a[i][j]);
                 dontcount.put(a[i][j], 0);
             }
         }
        ArrayList<Integer> nums = new ArrayList<Integer>();
        for(int i=0; i<n; i++) {
            int next = vals.poll();
            if(dontcount.get(next) > 0) {
                dontcount.put(next, dontcount.get(next)-1);
                i--;
                continue;
            }
            for(int j : nums) {
                dontcount.put(GCD(next, j), dontcount.get(GCD(next, j)) + 2);
            }
            dontcount.put(next, dontcount.get(next) + 1);
            nums.add(next);
        }
        
         for(int i : nums) out.print(i + " ");
        // int n = Integer.parseInt(st.nextToken());
        // int n = scan.nextInt();
        
        out.close(); System.exit(0);
    }
    public static int GCD(int a, int b) {
           if (b==0) return a;
           return GCD(b,a%b);
        }
}
