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

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());
        ArrayList<Long> list = new ArrayList<Long>(n * n);
        HashMap<Long, Integer> map = new HashMap<Long, Integer>();
        for (String str : reader.readLine().split(" ")) {
            Long i = Long.valueOf(str);
            if (map.containsKey(i)) {
                map.put(i, map.get(i) + 1);
            } else {
                map.put(i, 1);
            }
            list.add(i);
        }
        Collections.sort(list, Collections.reverseOrder());
        ArrayList<Long> gcdMainDiagonalValues = new ArrayList<Long>();
        outerLoop: for (int i = 0; i < list.size(); i++) {
            if (map.get(list.get(i)) == 0) {
                continue outerLoop;
            }
            for (Long long1 : gcdMainDiagonalValues) {
                long tempGcd = gcd(long1, list.get(i));
                map.put(tempGcd, map.get(tempGcd) - 2);
            }
            gcdMainDiagonalValues.add(list.get(i));
            map.put(list.get(i), map.get(list.get(i)) - 1);
        }
        for (Long long1 : gcdMainDiagonalValues) {
            System.out.print(long1 + " ");
        }
    }
}
