import java.util.*;
import java.io.*;
public class GCD_Table
{
	public static void main(String args[]) throws Exception
	{
		BufferedReader f=new BufferedReader(new InputStreamReader(System.in));
		int size=Integer.parseInt(f.readLine());
		PriorityQueue<Integer> queue=new PriorityQueue<Integer>(Collections.reverseOrder());
		StringTokenizer st=new StringTokenizer(f.readLine());
		for(int x=0;x<size*size;x++)
		{
			int temp=Integer.parseInt(st.nextToken());
			queue.add(temp);
		}
		int[] ans=new int[size];
		int pos=0;
		HashMap<Integer,Integer> lazy_del=new HashMap<Integer,Integer>();
		while(!queue.isEmpty())
		{
			int temp=queue.poll();
			for(int x=0;x<pos;x++)
			{
				int thing=gcd(temp,ans[x]);
				if(lazy_del.containsKey(thing))
					lazy_del.put(thing,lazy_del.get(thing)+2);
				else
					lazy_del.put(thing,2);
			}
			while(lazy_del.containsKey(queue.peek()))
			{
				int thing=queue.poll();
				if(lazy_del.get(thing)==1)
					lazy_del.remove(thing);
				else
					lazy_del.put(thing,lazy_del.get(thing)-1);
			}
			ans[pos]=temp;
			pos++;
		}
		for(int x=0;x<ans.length;x++)
			System.out.print(ans[x]+" ");
		System.out.println();
	}
	public static int gcd(int a,int b)
	{
		if(b==0) return a;
		return gcd(b,a%b);
	}
}