import java.util.* ;
import java.io.* ;

public class GCDTable 
{
    public static void main(String args[]) throws Exception 
    {
        BufferedReader bro = new BufferedReader(new InputStreamReader(System.in)) ;
        int n = Integer.parseInt(bro.readLine()) ;
        String[] S = bro.readLine().split(" ") ;
        int[] a = new int[n*n] ;
        HashMap<Integer,Integer> HM = new HashMap<Integer,Integer>() ;
        for(int i=0;i<n*n;i++)
        {
            a[i] = Integer.parseInt(S[i]) ;
            if(!HM.containsKey(a[i])) HM.put(a[i],1) ;
            else HM.put(a[i],HM.get(a[i])+1) ;
        }
        Arrays.sort(a) ;
        List<Integer> ans = new ArrayList<Integer>() ;
        for(int i=n*n-1;i>=0;i--)
        {
            if(HM.get(a[i])>0)
            {
                HM.put(a[i],HM.get(a[i])-1) ;
                for(int j=0;j<ans.size();j++)
                {
                    int g = gcd(a[i],ans.get(j)) ;
                    HM.put(g,HM.get(g)-2) ;
                }
                ans.add(a[i]) ;
            }
        }
        for(int i=0;i<ans.size();i++)
            System.out.print(ans.get(i)+" ");
        System.out.println();

    }
    static int gcd(int a,int b)
    {
        if(a==0) return b ;
        else return gcd(b%a,a) ;
    }
}