#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, N = 1e5 + 10, mx = 0;
cin >> n;
vector<int> a(n + 1), vis(N), p(N), ans(N, 1);
for (int i = 1; i <= n; i++){
cin >> a[i];
vis[a[i]]++;
mx = max(mx, a[i]);
}
sort(a.begin(), a.end());
for (int i = 2; i <= mx; i++){
//if (p[i] != 1){
int cnt = 0;
for (int j = 1; j <= n; j++){
//p[j] = 1;
if (a[j] % i == 0) cnt++;
}
for (int k = 1; k <= cnt; k++){
ans[k] = max(ans[k], i);
}
//}
}
if (mx == 0){
for (int i = 1; i <= n; i++){
cout << mx << ' ';
}
return 0;
}
if (mx == 1){
for (int i = 1; i <= n; i++){
cout << mx << ' ';
}
return 0;
}
for (int i = 1; i <= n; i++){
cout << ans[i] << ' ';
}
cout << endl;
}