
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Div3_724 {

	static void sort(int[] a) {
		ArrayList<Integer> l = new ArrayList<>();
		for (int i : a)
			l.add(i);
		Collections.sort(l);
		for (int i = 0; i < a.length; i++)
			a[i] = l.get(i);
	}

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

	static void delete(int x) {
		int y = map.get(x);
		y--;
		if (y == 0) {
			map.remove(x);
		} else {
			map.put(x, y);
		}
	}

	static TreeMap<Integer, Integer> map;
	static int[] arr = new int[505];

	public static void main(String[] args) {
		FastReader sc = new FastReader();

		int t = 1;
		out: while (t-- > 0) {
			int m = sc.nextInt();
			int n = m * m;

			map = new TreeMap<>();

			for (int i = 0; i < n; i++) {
				int a = sc.nextInt();
				map.put(a, map.getOrDefault(a, 0) + 1);
			}

			for (int i = m; i >= 1; i--) {

				int x = map.lastKey();
//				System.out.println(x);
				arr[i] = x;
				delete(gcd(x, x));

				for (int j = i + 1; j <= m; j++) {
//					System.out.println(arr[j]);
					delete(gcd(x, arr[j]));
					delete(gcd(x, arr[j]));
				}

			}

			for (int i = 1; i <= m; i++) {
				System.out.print(arr[i] + " ");
			}
			System.out.println();
		}

	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long[] readArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}
