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(" ");
		for (int i = 0; i < N*N;i++) {
			int val = Integer.parseInt(spl[i]);
			arr[i] = val;
		}
		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 (val == -1) continue;
				int cnt = 0;
				for (int j = arr.length-1; j >= 0; j--) {
					int val2 = arr[j];
					if (val % val2 == 0 && val2 != -1 && j != i) cnt++;
				}
				if (cnt % 2 == 0) {
					print.add(val);
					arr[i] = -1;
					worked = true;
					break;
				}
			}
			if (!worked) {
				for (int i = 0; i < arr.length; i++) {
					int val = arr[i];
					if (val == -1) continue;
					int cnt = 0;
					for (int j = arr.length-1; j >= 0; j--) {
						int val2 = arr[j];
						if (val % val2 == 0 && val2 != -1 && j != i) cnt++;
					}
					if (cnt % 2 != 0) {
						print.add(val);
						arr[i] = -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();
	}
}