import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 *
 * @author Zhasan
 */
public class A582 {

    public static void main(String args[]) throws Exception {
        Scanner in = new Scanner(System.in);

        Map<Long, Integer> map = new HashMap<>();

        int n = in.nextInt();

        int size = n * n;

        long arr[] = new long[size];

        for (int i = 0; i < size; i++) {
            arr[i] = in.nextLong();
            if (map.containsKey(arr[i])) {
                map.put(arr[i], map.get(arr[i]) + 1);
            } else {
                map.put(arr[i], 1);
            }
        }
        
        Arrays.sort(arr);
        
        long a[] = new long[n];
        int k = n-1;
        for(int i = size-1;i>=0;i--){
            long key = arr[i];
            
            if(map.get(key)>0){
                map.put(key, map.get(key)-1);
                a[k] = key;
                
                for(int j = k+1;j<n;j++){
                    long gcd = gcd(key,a[j]);
                    map.put(gcd, map.get(gcd)-2);
                }
                
                
                
                k--;
                if(k < 0){
                    break;
                }
            }
        }
        
        for(long l:a){
            System.out.print(l+" ");
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

}
