import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Abc {
    public static void main(String[] args) throws IOException {
        FastReader sc = new FastReader();
        int n=sc.nextInt();
        TreeMap<Integer,Integer> map=new TreeMap<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        Integer arr[]=new Integer[n*n];
        for (int i=0;i<n*n;i++){
            int x=sc.nextInt();
            arr[i]=x;
            map.put(x,map.getOrDefault(x,0)+1);
        }
        Arrays.sort(arr, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        ArrayList<Integer> ans=new ArrayList<>();
        for (int k=0;k<n*n;k++){
            int i=arr[k];
//            System.out.println(i);
            if (map.get(i)==0)continue;
            map.put(i,map.get(i)-1);
            for (int j:ans){
                int g=gcd(i,j);
//                System.out.println(i+" "+j);
                map.put(g,map.get(g)-2);
            }
            ans.add(i);
        }
//        if (ans.size()!=n){
//            for (int i:map.keySet()){
//                if (map.get(i)==0)continue;
//                for (int j=0;j<map.get(i);j++){
//                    ans.add(i);
//                }
//            }
//        }
        StringBuilder sb=new StringBuilder();
        for (int i=0;i<n;i++){
            sb.append(ans.get(i)+" ");
        }
        System.out.println(sb);
    }
    static int gcd(int a,int b){
        if (a==0)return b;
        return gcd(b%a,a);
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}