#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <set>

#pragma comment(linker, "/STACK:1024000000")
#define EPS (1e-8)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 365LL*24LL*60LL*60LL


using namespace std;

map<int,int> ans;

vector<pair<int,int> > vec;

vector<int> anw;

bool cmp(pair<int,int> a,pair<int,int> b)
{
//    if(a.second%2 != b.second%2)
//        return a.second%2 >= b.second;
    return a.first > b.first;
}

int main()
{
    int n,i,j,k;

    scanf("%d",&n);

    int x;

    for(i = 1; i <= n*n; ++i)
    {
        scanf("%d",&x);
        ans[x]++;
    }

    map<int,int>::iterator it = ans.end();

    do
    {
        --it;

        for(i = 1;i*i < it->second; ++i)
            ;

        if(i*i == it->second)
        {
            for(j = 0;j < i; ++j)
                for(k = 0;k < anw.size(); ++k)
                {
                    if(ans.find(__gcd(it->first,anw[k])) != ans.end())
                        ans[__gcd(it->first,anw[k])]--;
                }

            while(i--) anw.push_back(it->first);
        }
    }
    while(it != ans.begin());

    for(i = 0; i < n; ++i)
        printf("%d%c",anw[i],i == n ? '\n' : ' ');

    return 0;
}
