import java.util.*;
import java.io.*;
public class A
{
      public static void main(String ar[]) throws Exception
      {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            int n=Integer.parseInt(br.readLine());
            TreeMap<Integer,Integer> tm=new TreeMap<Integer,Integer>();
            String s1[]=br.readLine().split(" ");
            for(int i=0;i<n*n;i++)
            {
                  int u=Integer.parseInt(s1[i]);
                  if(tm.containsKey(u))
                   tm.put(u,1+tm.get(u));
                  else
                   tm.put(u,1);
            }
            
            StringBuffer sb=new StringBuffer();
            ArrayList<Integer> al=new ArrayList<Integer>();
            while(!tm.isEmpty())
            {
                  int u=tm.lastKey();
                  if(tm.get(u)>1)
                    tm.put(u,tm.get(u)-1);
                  else
                    tm.remove(u);
                  //System.out.println(u);
                  for(int i=0;i<al.size();i++)
                  {
                        int x=gcd(u,al.get(i));
                        if(tm.get(x)>1)
                         tm.put(x,tm.get(x)-1);
                        else
                         tm.remove(x);
                        
                        if(tm.get(x)>1)
                         tm.put(x,tm.get(x)-1);
                        else
                         tm.remove(x);
                  }
                  al.add(u);
                  sb.append(u).append(" ");
            }
            
            System.out.println(sb);
      }
      
      public static int gcd(int a,int b)
      {
            if(b==0)
             return a;
            return gcd(b,a%b);
      }
}