#include<bits/stdc++.h>
using namespace std;
int sum[10001],a[10001],ans[1001];
int n,m,t;
inline const void read(int &x)
{
x=0;
int k=1;
char c=getchar();
if(c=='-')
{
k=-1;
c=getchar();
}
while(c>'9'||c<'0')
c=getchar();
while(c>='0'&&c<='9')
{
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
x*=k;
}
int main()
{
//freopen("ma.in.txt","r",stdin);
read(n);read(m);read(t);
for(int i=1;i<=m;i++)
{
int c,b,MAX=0;
memset(sum,0,sizeof(sum));
for(int j=1;j<=n;j++)
{
read(a[j]);
sum[j]=sum[j-1]+a[j];
}//cout<<"**"<<endl;
//for(int k=1;k<=n;k++)
//cout<<"sum["<<k<<"]="<<sum[k]<<endl;
for(int j=1;j<=n;j++)
{
for(int k=1;k<=t;k++)
{
if(j+k-1<=n)
{
int temp=sum[j+k-1]-sum[j-1];
//cout<<"j="<<j<<" k="<<k<<" temp="<<temp<<endl;
if(temp>MAX)
{
MAX=temp;
//cout<<"MAX="<<MAX<<endl;
c=j;
b=j+k-1;
}
}
}
}
//cout<<"c="<<c<<" b="<<b<<endl;
for(int j=c;j<=b;j++)
ans[j]++;
}
for(int i=1;i<=n;i++)
cout<<ans[i]<<' ';
cout<<endl;
return 0;
}