import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

public class GCDTable {

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

    public static void main(String[] args) throws IOException {

        BufferedReader reader = new BufferedReader(new InputStreamReader(
                System.in));
        int n = Integer.valueOf(reader.readLine());
        long[] is = new long[n * n];
        int index = 0;
        for (String str : reader.readLine().split(" ")) {
            is[index++] = Integer.valueOf(str);
        }
        HashMap<Long, Integer> map = new HashMap<Long, Integer>();
        for (long i : is) {
            if (map.containsKey(i)) {
                map.put(i, map.get(i) + 1);
            } else {
                map.put(i, 1);
            }
        }
        ArrayList<Long> arrayList = new ArrayList<Long>(n);
        for (Long long1 : map.keySet()) {
            if (map.get(long1) > 0 && map.get(long1) % 2 != 0) {
                // System.out.println(freqArr[i] + " " + i);
                arrayList.add(long1);
                map.put(long1, map.get(long1) - 1);
            }
        }
        for (int i = 0; i < arrayList.size(); i++) {
            for (int j = 0; j < arrayList.size(); j++) {
                if (i != j) {
                    long temp = gcd(arrayList.get(i), arrayList.get(j));
                    map.put(temp, map.get(temp) - 1);
                }
            }
        }
        for (Long long1 : map.keySet()) {
            if (map.get(long1) > 0 && map.get(long1) % 2 != 0) {
                // System.out.println(freqArr[i] + " " + i);
                arrayList.add(long1);
                map.put(long1, map.get(long1) - 1);
            }
        }
        if (arrayList.size() < n) {
            int size = arrayList.size();
            for (int i = 1; i <= n - size; i++) {
                arrayList.add(1L);
            }
        }
        Collections.sort(arrayList);
        for (Long integer : arrayList) {
            System.out.print(integer + " ");
        }
    }
}