import java.util.*;
public class sport{
	static long gcd(long a,long b){
		while ((a!=0)&(b!=0)){
			if (a>b) a=a%b;
			else
				b=b%a;
		}
		if (a==0)
			return b;
		else
			return a;
	}
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		HashMap<Long,Integer> map=new HashMap<Long,Integer>();
		ArrayList<Long> list=new ArrayList<Long>();
		int n=in.nextInt();
		for (int i=0; i<n*n; i++){
			long x=in.nextLong();
			if (map.containsKey(x))
				map.put(x,map.get(x)+1);
			else
				map.put(x,1);
			list.add(x);
		}
		Collections.sort(list);
		ArrayList<Long> out=new ArrayList<Long>();
		for (int i=list.size()-1; i>=0; i--){
			long y=list.get(i);
			if (map.get(y)==0) continue;
			for (long b :out){
				long g=gcd(b,y);
				map.put(g,map.get(g)-2);
			}
			out.add(y);
			map.put(y,map.get(y)-1);
		}
		for (long b :out){
			System.out.print(b+" ");
		}
	}
}