import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;

public class GCDTable {
	public static void main(String[] args) throws IOException {
		InputReader r = new InputReader(System.in);
		int n = r.nextInt();
		int[] a = new int[n * n];
		ArrayList<Integer> numbers = new ArrayList<Integer>();
		for (int i = 0; i < a.length; i++) {
			a[i] = r.nextInt();
			numbers.add(a[i]);
		}
		Arrays.sort(a);
		Collections.sort(numbers);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int index = a.length - 1;
		HashMap<Integer, Integer> set = new HashMap<Integer, Integer>();
		while (index > 0) {
			while (index > 0 && set.containsKey(a[index])) {
				int nv = set.get(a[index]) - 2;
				if (nv == 0) {
					set.remove(a[index]);
				} else {
					set.put(a[index], nv);
				}
				index -= 2;
			}
			if (index < 0)
				break;
			int max = a[index--];
			for (int x : list) {
				int gcd = gcd(max, x);
				if (!set.containsKey(gcd))
					set.put(gcd, 0);
				set.put(gcd, set.get(gcd) + 2);
			}
			list.add(max);
		}
		for (int x : list)
			System.out.println(x);
	}

	static int gcd(int n1, int n2) {
		if (n2 == 0) {
			return n1;
		}
		return gcd(n2, n1 % n2);
	}

	static class InputReader {
		private BufferedReader reader;
		private StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public InputReader(FileReader stream) {
			reader = new BufferedReader(stream);
			tokenizer = null;
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

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

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