#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define endl '\n'
#define ff first
#define ss second
void edm()
{
ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
}
void solve()
{
int n;cin>>n;
map<int,int>mp;
int cnt=0;
for(int i=0;i<n;i++)
{
int x;cin>>x;
for(int j=1;j<=x;j++)
{
if(x%j==0)mp[j]++;
}
}
int mn=1e9;
for(int i=1;i<=n;i++)
{
int mx=0;
for(auto j:mp)
{
if(j.ss+cnt>=i)
{
mx = max(mx,j.ff);
}
}
if(mx)cout<<mx<<" ";
else cout<<mn<<" ";
if(mx!=0)mn = min(mn,mx);
}
cout<<endl;
}
int32_t main()
{
//edm();
int t = 1;
//cin>>t;
for(int i=1;i<=t;i++)
{
solve();
}
}