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=1;
		ret[0]=A[0];
		for(int i=1;i<n*n;i++) {
			if(!map.containsKey(A[i])) {
				ret[p++]=A[i];
				for(int j=0;j<i;j++) {
					int v=(int)gcd(A[i],A[j]);
					map.put(v,map.getOrDefault(v, 0)+2);
				}
			}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+" ");
	}
	private boolean check2(boolean[] vis1, boolean[] vis2) {
		for(int i=0;i<7;i++) {
			if(vis1[i]==vis2[i]&&vis1[i])return false;
		}
		return true;
	}
	private boolean check1(int n, boolean[] vis,int b) {
		while(b-->0) {
			if(vis[n%7])return false;
			vis[n%7]=true;
			n/=7;
		}
		return true;
	}
	private int check(int n) {
		n--;
		int cnt=0;
		while(n>0) {
			n/=7;
			cnt++;
		}
		return Math.max(cnt,1);
	}
}	



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());
	}
}