import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
        for (int i = 0; i < n * n; i++) {
            int ai = sc.nextInt();
            int cnt = map.containsKey(ai) ? map.get(ai) : 0;
            map.put(ai, ++cnt);
        }
        sc.close();

        ArrayList<Integer> a = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            int max = 0;
            for (Integer key : map.keySet())
                max = Math.max(max, key);
            remove(max, 1, map);
            for (Integer ai : a)
                remove(gcd(ai, max), 2, map);
            a.add(max);
        }

        for (Integer ai : a)
            System.out.print(ai + " ");
    }

    private static void remove(int key, int cnt, HashMap<Integer, Integer> map) {
        int ncnt = map.get(key) - cnt;
        if (ncnt == 0)
            map.remove(key);
        else
            map.put(key, ncnt);
    }

    private static int gcd(int a, int b) {
        while (b > 0) {
            int tmp = a % b;
            a = b;
            b = tmp;
        }
        return a;
    }
}
