import java.io.*;
import java.util.*;
public class Solution {
	 static class FastReader {
	        BufferedReader br; 
	        StringTokenizer st; 
	        public FastReader() {
	        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
	        	if(!env) {
	        		try {
						br=new BufferedReader(new FileReader("src\\input.txt"));
					} catch (FileNotFoundException e) {
						e.printStackTrace();
					}
	        	}
	        	else br = new BufferedReader(new InputStreamReader(System.in)); 
	        } 
	        String next() {
	            while (st == null || !st.hasMoreElements()) {
	                try {
	                    st = new StringTokenizer(br.readLine()); 
	                } 
	                catch (IOException  e) {
	                    e.printStackTrace(); 
	                } 
	            } 
	            return st.nextToken(); 
	        } 
	        int nextInt() {
	            return Integer.parseInt(next()); 
	        } 
	        long nextLong() {
	            return Long.parseLong(next()); 
	        } 
	        double nextDouble() {
	            return Double.parseDouble(next()); 
	        } 
	        String nextLine() {
	            String str = ""; 
	            try {
	                str = br.readLine(); 
	            } 
	            catch (IOException e) {
	                e.printStackTrace(); 
	            } 
	            return str; 
	        } 
	    }
	static FastReader sc=new FastReader();
	static PrintWriter out=new PrintWriter(System.out);
	static long gcd(long a,long b) {
		return b==0?a:gcd(b,a%b);
	}
	//Main
	public static void main(String args[]) {
		int test=1;
		//test=sc.nextInt();
		while(test-->0) {
			//Focus
			int n=sc.nextInt();
			TreeMap<Long,Integer> map=new TreeMap<>(Collections.reverseOrder());
			for(int i=0;i<n*n;i++) map.merge(sc.nextLong(), 1, Integer::sum);
			ArrayList<Long> ans=new ArrayList<>();
			for(Long key: map.keySet()) {
				if(map.get(key)<=0) continue;
				for(Long x: ans) map.merge(gcd(x,key), -2, Integer::sum);
				map.merge(key, -1, Integer::sum);
				ans.add(key);
			}
			for(Long x: ans) out.print(x+" ");
		}
		out.flush();
		out.close();
	}
}
