import java.util.*;
    import java.io.*;

    public class Codeforces {
        
        
        public static void main(String[] args) throws IOException {
            Reader.init(System.in);
                int n = Reader.nextInt();
                HashMap<Integer, Integer> map = new HashMap<>();
                int arr[] = new int[n*n];
                
                Integer x;
                for(int i = 0; i < n*n; i++){
                    int y = Reader.nextInt();
                    x = map.get(y);
                    
                    if(x == null){
                        x = 0;
                        map.put(y, 0);
                    }
                    
                    x++;
                    map.put(y, x);
                    
                    arr[i] = y;
                }
                
                Arrays.sort(arr);
                int ans[] = new int[n];
                int j = n*n-1;
                
                for(int i = 0; i < n; i++){
                    while(map.get(arr[j]) == 0)
                        j--;
                    
                    ans[i] = arr[j];
                    map.put(ans[i], map.get(ans[i]) - 1);
                    
                    for(int k = 0; k < i; k++){
                        int g = gcd(ans[k], ans[i]);
                        map.put(g, map.get(g) - 2);
                    }
                }
                
                for(int e : ans)
                    System.out.print(e + " ");
        }
        
        static int gcd(int a, int b){
            if(b == 0)
                return a;
            return gcd(b, a%b);
        }
    }
    
    class  Edge implements Comparable<Edge>{

        int to;
        int from;
        int cost;
        
        Edge(int a, int b, int c){
            from = a;
            to = b;
            cost = c;
        }

        @Override
        public int compareTo(Edge t) {
            return t.cost - cost;
        }
    }


    class NN implements Comparable<NN>{
        int x;
        int mod;
        
        NN(int a, int b){
            x = a;
            mod = b;
        }

        @Override
        public int compareTo(NN t) {
            return mod - t.mod;
        }
        
    }


    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

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

        static int nextInt() throws IOException {
            return pars(next());
        }

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

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