#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<map>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
typedef long long ll;
const int maxn=2007,mo=4*1e6+7;
ll i,j,k,l,t,n,m,pp;
ll ans[maxn],p[40000];
ll a[maxn],sum,ma[mo];
int h[mo][2];
int hash(ll x){
ll y=x%mo;
while(h[y][0]!=x&&h[y][0]!=0&&h[y][1]==i){
y=y+1;
if(y>=mo)y-=mo;
}
h[y][0]=x;
if(h[y][1]!=i)h[y][1]=i,ma[y]=0;
return y;
}
bool cmp(ll x,ll y){return x>y;}
int main(){
// freopen("fan.in","r",stdin);
// freopen("fan.out","w",stdout);
scanf("%lld",&n);
fo(i,1,n)scanf("%lld",&a[i]),sum+=a[i];
fo(i,1,sqrt(sum)){
if(sum%i==0){
p[++p[0]]=i;
if(i*i==sum)break;
p[++p[0]]=sum/i;
}
}
sort(p+1,p+p[0]+1,cmp);
l=1;
fo(i,1,p[0]){
k=0;
fo(j,1,n){
k=(k+a[j])%p[i];
pp=hash(k);
ma[pp]++;
t=max(ma[pp],t);
}
while(t>=l&&l<=n){
ans[l]=p[i];
l++;
}
}
fo(i,1,n){
printf("%lld\n",ans[i]);
}
}