# include<bits/stdc++.h>
# define int long long
# define MOD 1000000007
# define endl '\n'
# define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
# define f first
# define s second
# define pi pair<int,int>
using namespace std ;

// all codes of codeforces in this file

bool compare(pair<int,int> p1, pair<int,int> p2)
{
	return p1.f > p2.f ;
}

int32_t main()
{
	fastio
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
   int n ; cin>>n ;
   int mat[n+1][n+1] ;
   memset(mat,0,sizeof(mat)) ;
   map<int,int> mp ;
   int x ;
   for(int i=0;i<n*n;i++) cin>>x, mp[x]++ ;
   if(mp.size() == 1)
   {
   	 for(int i=0;i<n;i++) cout<<mp.begin()->f<<" " ;
   	 	cout<<endl ;
   	 return 0 ;
   }
   vector<pair<int,int>> v ;
   for(auto p : mp) v.push_back({p.f,p.s}) ;
   sort(v.begin(),v.end(),compare) ;
   /*for(int i=0;i<n;i++) cout<<v[i].f<<" " ;
   	cout<<endl ;*/
   int dim = n ;
   for(int i=0;i<n;i++)
   {
   	 auto p = v[i] ;
   	 if(mp[p.f] == 0) continue ;
   	 //cout<<p.s<<" " ;
   	 mat[dim][dim] = p.f ;
   	 mp[p.f]-- ;
   	 for(int i=dim+1;i<=n;i++)
   	 {
   	 	mat[dim][i] = mat[i][dim] = __gcd(mat[dim][dim],mat[i][i]) ;
   	 	mp[__gcd(mat[dim][dim],mat[i][i])] -= 2 ;

   	 }

     dim-- ;

   }

   for(int i=1;i<=n;i++) cout<<mat[i][i]<<" " ;
   	cout<<endl ;

}