import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class CF2
{
	public static void main(String[] args) throws Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int n = Integer.parseInt(br.readLine());
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		Integer[] values = new Integer[n*n];
		PriorityQueue<Integer> pq = new PriorityQueue<>((a,b) -> b-a);
		for (int i = 0; i < n*n; i++)
		{
			pq.add(Integer.parseInt(st.nextToken()));
		}
		int[] arr = new int[n];
		int index = 0;
		PriorityQueue<Integer> removed = new PriorityQueue<>((a,b) -> b-a);
		while (index < n)
		{
			Integer highest = pq.poll();
			Integer rem = removed.poll();
			while (highest == rem)
			{
				highest = pq.poll();
				rem = removed.poll();
			}
			if (rem != null)
				removed.add(rem);
			arr[index++] = highest;
			for (int i = 0; i < index-1; i++)
			{
				int g = gcd(highest, arr[i]);
				removed.add(g);
				removed.add(g); //add once for each side
			}
		}
		
		for (int i = 0; i < arr.length; i++)
			pw.print((i != 0 ? " " : "") + arr[i]);
		pw.flush();
		br.close();
	}
	
	private static int gcd(int a, int b)
	{
		return b == 0 ? a : gcd(b, a%b);
	}
}