import java.util.*;

public class GCDTable {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());

		int[] arr = new int[N*N];
		int min = Integer.MAX_VALUE;
		String[] spl = sc.nextLine().split(" ");
		TreeMap<Integer, Integer> black = new TreeMap<Integer, Integer>();
		for (int i = 0; i < N*N;i++) {
			int val = Integer.parseInt(spl[i]);
			arr[i] = val;
			if (!black.containsKey(val)) black.put(val, 1);
			else black.put(val, black.get(val)+1);
		}
		ArrayList<Integer> print = new ArrayList<Integer>();
		Arrays.sort(arr);
		while (print.size() != N) {
			boolean worked = false;
			for (int i = arr.length-1; i >= 0; i--) {
				int val = arr[i];
				if (black.get(val) <= 0) continue;
				int cnt = 0;
				for (Map.Entry<Integer, Integer> ent : black.entrySet()) {
					int val2 = ent.getKey();
					if (val2 > val) break;
					if (val % val2 == 0) {
						int add = ent.getValue();
						if (val == val2) add--;
						if (add >= 2)
						cnt += add;
					}
				}
				if (cnt % 2 == 0 && (cnt >= 2*(N-print.size()-1) || N == 1)) {
					for (Integer x : print) {
						int gcd = gcd(val, x);
						if (black.containsKey(gcd)) black.put(gcd, black.get(gcd)-2);
					}
					print.add(val);
					black.put(val, black.get(val)-1);
					worked = true;
					break;
				}
			}
			if (!worked) {
				for (int i = arr.length-1; i >= 0; i--) {
					int val = arr[i];
					if (black.get(val) <= 1) continue;
					int cnt = 0;
					for (Map.Entry<Integer, Integer> ent : black.entrySet()) {
						int val2 = ent.getKey();
						if (val2 > val) break;
						if (val % val2 == 0) {
							int add = ent.getValue();
							if (val == val2) add -= 2;
							if (add % 2 == 0)
							cnt += add;
						}
					}
					if (cnt % 2 == 0 && (cnt >= 2*(N-print.size()-1) || N == 1)) {
						for (Integer x : print) {
							int gcd = gcd(val, x);
							if (black.containsKey(gcd)) black.put(gcd, black.get(gcd)-2);
						}
						print.add(val);
						black.put(val, black.get(val)-1);
						worked = true;
						break;
					}
				}
			}
		}
		System.out.print(print.get(0));
		for (int i = 1; i < print.size(); i++) {
			System.out.print(" " + print.get(i));
		}
		System.out.println();
	}

	static int gcd(int x, int y) {
		if (x == 0) return y;
		if (y == 0) return x;
		return gcd(y, x%y);
	}
}