#include <bits/stdc++.h>
using namespace std;
#define SC scanf
#define PF printf
#define ull unsigned long long
#define ld long double
#define F first
#define S second
#define pb push_back
#define sort_a(a) sort(a.begin(),a.end());
#define sort_d(a) sort(a.rbegin(),a.rend());
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)
#define rev(s) reverse(s.begin(),s.end())
#define P(ok) cout << (ok ? "YES\n": "NO\n")
#define __Heart__ ios_base :: sync_with_stdio(false); cin.tie(NULL);
#define ll long long
typedef pair< ll , ll> PII;
const int sz = 1e5 + 5 ;
vector < int > divisor[sz] ;
void preCaldivisor() {
for (int i = 1; i <= 1e5; ++i) {
for (int j = i; j <= 1e5 ; j += i) {
divisor[j].pb(i);
}
}
}
void solve()
{
map < int , int > freq ;
int n , a; cin >> n ;
int res[n + 5];
set < int > st ;
for(int i = 1 ; i <= n ; i++) res[i] = 1 ;
for(int i = 1 ; i <= n ; i++){
cin >> a ;
if(!a) freq[a]++ ;
for(auto it : divisor[a]) freq[it]++ , st.insert(it) ;
}
for(auto it : st){
for(int i = 1 ; i <= freq[it] + freq[0] ; i++) res[i] = max(res[i] , it) ;
}
for(int i = 1 ; i <= n ; i++) cout << res[i] << " " ;
cout << endl ;
}
int main()
{
__Heart__
preCaldivisor() ;
int t ; t = 1 ; while(t--) solve() ;
}