import java.io.*;
import java.math.BigInteger;
import java.util.*;


public class JavaApplication7 
{
static int gcd(int a , int b)
{
 if(a == 0)
     return b ;
 int x = Math.max(a, b) ;
 int y = Math.min(a, b) ;
 return gcd(x% y , y) ; 
}


    public static void main(String[] args) throws Exception
    {
      Reader.init(System.in);
      StringBuilder ans = new StringBuilder() ;
      Map<Integer , Integer> mp = new TreeMap<Integer, Integer> ();
      int n = Reader.nextInt() ;
      Integer ar [] = new Integer [n*n] ;
      for(int i = 0 ; i < n*n ; i++)
      {ar[i] = Reader.nextInt() ;
          
          
       if(mp.containsKey(ar[i]))
           mp.put(ar[i], mp.get(ar[i]) + 1) ;
       else 
           mp.put(ar[i], 1) ;
      }
       
      Arrays.sort(ar);
      ArrayList<Integer> li = new ArrayList<Integer>() ;
      li.add(ar[n*n-1]) ;
      mp.put(ar[n*n-1],mp.get(ar[n*n-1]) - 1) ;
      int l = 1 ;
      for(int i = n*n - 2 ; i >= 0 ; i--) 
      {
       int x = ar[i] ; 
       if(mp.get(x) > 0)
       { for(int j = 0 ; j < l ; j++)
       {       int z = gcd(li.get(j) , x) ;
               
               mp.put(z , mp.get(z) - 2 )  ;
       
       }
         mp.put(x,mp.get(x) - 1) ;
         li.add(x) ;
         l++;
       }
       
      }
      
      for(int i = 0 ; i < li.size() ; i++)
            ans.append(li.get(i) + " ");
         System.out.println(ans); 
    
    }
       
}
        
    
    
    class pair implements Comparable<pair>
    {
     int  mod , w; 
     String a ;
     double pr ;
    pair(double a , int b)
    {
    pr = a ;
    mod = b ;
    
    
   
  
    }
    @Override
    public int compareTo(pair t) {
        if(t.pr <pr)
            return 1 ;
        else if(t.pr > pr) return -1 ;
        else return 0 ;
    }
    
    
    
    }

   
    
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

   
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
	
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    static long nextLong() throws IOException{
    return Long.parseLong(next()) ;
    }
}