import java.util.*;
import java.io.*;

public class Main {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		work();
		out.flush();
	}
	long mod=998244353;
	long gcd(long a,long b) {
		return b==0?a:gcd(b,a%b);
	}
	void work() {
		int n=in.nextInt();
		Integer[] A=new Integer[n*n];
		for(int i=0;i<n*n;i++)A[i]=in.nextInt();
		Arrays.sort(A,new Comparator<Integer>() {
			public int compare(Integer a,Integer b) {
				return b-a;
			}
		});
		HashMap<Integer,Integer> map=new HashMap<>();
		int[] ret=new int[n];
		int p=0;
		for(int i=0;i<n*n;i++) {
			if(!map.containsKey(A[i])) {
				for(int j=0;j<p;j++) {
					int v=(int)gcd(ret[j],A[i]);
					map.put(v,map.getOrDefault(v, 0)+2);
				}
				ret[p++]=A[i];
			}else {
				map.put(A[i],map.get(A[i])-1);
				if(map.get(A[i])==0)map.remove(A[i]);
			}
		}
		for(int r:ret)out.print(r+" ");
	}
}	



class FastReader
{
	BufferedReader br;
	StringTokenizer st;

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

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

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

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