//package GCDTable;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.TreeMap;

public class GcdTable {
	
	public static int gcd(int i, int j){
		int min=Math.min(i, j);
		int max=Math.max(i, j);
		if (max%min!=0)
			return gcd(min,max%min);
		return min;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		TreeMap<Integer,Integer> map = new TreeMap<Integer,Integer> ();
		String [] parts = br.readLine().split(" ");
		for(int i=0;i<n*n;i++){
			int key = Integer.parseInt(parts[i]);
			if (map.containsKey(key))
				map.put(key, map.get(key)+1);
			else
				map.put(key,1);
		}
		
		if (n==1){
			System.out.println(map.firstEntry().getKey());
			return;
		}
		
		
		ArrayList<Integer> resultList = new ArrayList<Integer> ();
		resultList.add(map.lastKey());
		map.put(map.lastKey(),map.get(map.lastKey())-1);
		if (map.get(map.lastKey())==0)
			map.pollLastEntry();
		
		while (resultList.size()<n){
			int newMax = map.lastKey();
			map.put(newMax,map.get(newMax)-1);
			
			if (map.lastEntry().getValue()==0)
				map.pollLastEntry();
			
			for (int k : resultList){
			
				int gcd=gcd(k,newMax);
				
				map.put(gcd, map.get(gcd)-2);
				if (map.get(gcd)==0)
					map.remove(gcd);
			}
			
			resultList.add(newMax);
		}
		
		for(int i=0;i<resultList.size();i++){
			System.out.print(resultList.get(i)+" ");
		}
		
	}
}
