#include<bits/stdc++.h>
using namespace std;
int m,n,t;
struct node
{
int left,num;
}ans[1001];
int a[1001],tt[1001];
inline const void read(int &a)
{
a=0;
int k=1;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
k=-1;
c=getchar();
}
while(c<='9'&&c>='0')
{
a=(a<<1)+(a<<3)+c-'0';
c=getchar();
}
a*=k;
}
int main()
{
//freopen("ma.in.txt","r",stdin);
cin>>n>>m>>t;
m=10;
for(int i=1;i<=m;i++)
{
for(int i=0;i<=1001&&ans[i].left;i++)
{
ans[i].left=0;
ans[i].num=0;
}
int front=0,rail=0,MAX=0;
for(int j=1;j<=n;j++)
{
read(a[j]);
if(ans[j-1].num==0&&ans[j-1].left==0)
{
ans[j].left=j;
ans[j].num=a[j];
MAX=a[j];
front=j;
rail=j;
//cout<<"1"<<endl;
//cout<<"j="<<j<<" MAX="<<MAX<<" front="<<front<<" rail="<<rail<<endl;
}
else if(ans[j-1].num<0)
{
ans[j].left=j;
ans[j].num=a[j];
if(MAX<ans[j].num)
{
MAX=ans[j].num;
front=j;
rail=j;
// cout<<"j="<<j<<" MAX="<<MAX<<" front="<<front<<" rail="<<rail<<endl;
}
// cout<<"2"<<endl;
}
else if(ans[j-1].num>=0)
{
if(j-ans[j-1].left<=t-1)
{
ans[j].left=ans[j-1].left;
ans[j].num=ans[j-1].num+a[j];
if(ans[j].num>MAX)
{
MAX=ans[j].num;
front=ans[j].left;
rail=j;
//cout<<"j="<<j<<" MAX="<<MAX<<" front="<<front<<" rail="<<rail<<endl;
}
//cout<<"3"<<endl;
}
else if(j-ans[j-1].left>t-1)
{
ans[j].left=ans[j-1].left+1;
ans[j].num=ans[j-1].num-a[ans[j-1].left]+a[j];
if(ans[j].num>MAX)
{
MAX=ans[j].num;
front=ans[j].left;
rail=j;
//cout<<"j="<<j<<" MAX="<<MAX<<" front="<<front<<" rail="<<rail<<endl;
}
//cout<<"4"<<endl;
}
}
}
//cout<<"front="<<front<<" rail="<<rail<<endl;
for(int j=front;j<=rail;j++)
tt[j]++;
}
for(int i=1;i<=n;i++)
cout<<tt[i]<<' ';
cout<<endl;
return 0;
}