import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map.Entry;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main2 {
	public static int gcd(int a,int b)
	{
		return b==0? a:gcd(b,a%b);
	}
	public static void main(String[] args) throws IOException 
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] arr = new int[n];
		TreeMap<Integer,Integer> set = new TreeMap<Integer,Integer>();
		for (int i = 0; i < n*n; i++) 
		{
			int x = Integer.parseInt(st.nextToken());
			if(set.containsKey(x))
				set.put(x, set.get(x)+1);
			else
				set.put(x, 1);
		}
		int ind = n-1;
		Entry<Integer, Integer> ent = set.pollLastEntry();
		arr[ind--] = ent.getKey();
		if(ent.getValue()>1)
			set.put(ent.getKey(), ent.getValue()-1);
		while(ind>=0)
		{
			Entry<Integer, Integer> e = set.pollLastEntry();
			int cur = e.getKey();
			arr[ind--] = cur;
			if(e.getValue()>1)
				set.put(e.getKey(), e.getValue()-1);
			for(int i = n-1;i>ind+1;i--)
			{
				int[] g = {gcd(arr[i],cur) , gcd(cur,arr[i])};
				for (int j = 0; j < g.length; j++) 
				{

					int val = set.get(g[j]);
					if(val>1)
						set.put(g[j], val-1);
					else
						set.remove(g[j]);
				}
			}
		}
		
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i]+" ");
		}
	}
}