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

public class File {
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            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());
        }
    }
	
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		
		
		
		int n = sc.nextInt();
		
		TreeMap<Long, Integer> counts = new TreeMap();
		TreeSet<Long> odds = new TreeSet<Long>();
		TreeSet<Long> evens = new TreeSet<Long>();
		
		long[] vals = new long[n*n];
		for (int i = 0; i < n*n; i++) {
			vals[i] = sc.nextLong();
			counts.put(vals[i], counts.getOrDefault(vals[i], 0) + 1);
		}
		
		for (long val : counts.keySet()) {
			if (counts.get(val) % 2 == 0) {
				evens.add(val);
			}
			else {
				odds.add(val);
			}
		}
		
		long[][] G = new long[n][n];
		int dIndex = 0;
		
		while (dIndex < n) {
			// Get the next largest element in the array that remains
			// place in diagonal.		
			Long largest = counts.lastKey();
			G[dIndex][dIndex] = largest;
			counts.put(largest, counts.get(largest) - 1);
			if (counts.get(largest) == 0) {
				counts.remove(largest);
				odds.remove(largest);
			}
			else {
				if (counts.get(largest) % 2 == 0) {
					odds.remove(largest);
					evens.add(largest);
				}
				else {
					evens.remove(largest);
					odds.add(largest);
				}
			}
			
			// Update all crossings with previous diagonal indices.
			for (int r = 0; r < dIndex; r++) {
				long gcd = getGCD(G[r][r], G[dIndex][dIndex]);
				G[r][dIndex] = gcd;
				G[dIndex][r] = gcd;
				
				counts.put(gcd, counts.get(gcd) - 2);
				if (counts.get(gcd) == 0) {
					counts.remove(gcd);
					odds.remove(gcd);
				}
				else {
					if (counts.get(gcd) % 2 == 0) {
						evens.remove(gcd);
						odds.add(gcd);						
					}
					else {
						odds.remove(gcd);
						evens.add(gcd);
					}
				}
			}
			
			dIndex++;
			
			if (dIndex < n && odds.size() > 0) {
				// Iterate over all elements remaining, and if odd count for any.
					// those must be on diagonal too.
					// Add to diagonal, then update crossings with previous diagonal indices.
				Long val = odds.first();
				
				G[dIndex][dIndex] = val;
				counts.put(val, counts.get(val) - 1);
				
				if (counts.get(val) == 0) {
					counts.remove(val);
					odds.remove(val);
				}
				else {
					if (counts.get(val) % 2 == 0) {
						odds.remove(val);
						evens.add(val);
					}
					else {
						evens.remove(val);
						odds.add(val);
					}
				}
				
				for (int r = 0; r < dIndex; r++) {
    				long gcd = getGCD(G[r][r], G[dIndex][dIndex]);
    				G[r][dIndex] = gcd;
    				G[dIndex][r] = gcd;
    				
    				counts.put(gcd, counts.get(gcd) - 2);
    				if (counts.get(gcd) == 0) {
    					counts.remove(gcd);
    					evens.remove(gcd);
    				}
    				else {
    					if (counts.get(gcd) % 2 == 0) {
    						evens.remove(gcd);
    						odds.add(gcd);
    					}
    					else {
    					    odds.remove(gcd);
    						evens.add(gcd);
    					}
    				}
    			}
    			
    			dIndex++;
			}
		}
		
		
		
		
		for (int i = 0; i < n; i++) {
			out.print(G[i][i] + " ");
		}
		
		
		out.close();
	}
	
	public static long getGCD(long a, long b) {
		if (b == 0) return a;
		return getGCD(b, a % b);
	}
}











	