//package GCDTable;

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

public class GcdTable {

	public static void main(String[] args) throws NumberFormatException, IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		ArrayList<Integer> list = new ArrayList<Integer> ();
		String [] parts = br.readLine().split(" ");
		for(int i=0;i<n*n;i++){
			list.add(Integer.parseInt(parts[i]));
		}
		
		if (n==1){
			System.out.println(list.get(0));
			return;
		}
		
		Collections.sort(list);
		Collections.reverse(list);
		
		ArrayList<Integer> resultList = new ArrayList<Integer> ();
		resultList.add(list.get(0));
		list.remove(0);
		
		while (resultList.size()<n){
			int newMax = list.get(0);
			//System.out.println("nov max : "+newMax);
			list.remove(0);
			
			for (int i=0;i<resultList.size();i++){
				int gcd=1;
				int index = 0;
				for(int j=0;j<list.size();j++){
					if (newMax%list.get(j)==0 && resultList.get(i)%list.get(j)==0 && list.get(j)>gcd){
						gcd=list.get(j);
						index=j;
						break;
					}
				}
				
				
				list.remove(index);
				list.remove(index);
				//System.out.println(index+" "+gcd);
			}
			resultList.add(newMax);
		}
		
		for(int i=0;i<resultList.size();i++){
			System.out.print(resultList.get(i)+" ");
		}
		
	}
}
