#include <stdio.h>
#include <iostream>
#define inf 1e9
using namespace std;
struct pair {
int index;
int val;
};
inline int read() {
int k=0;
char f=1;
char c=getchar();
for(; !isdigit(c); c=getchar() )
if(c=='-')
f=-1;
for(; isdigit(c); c=getchar() )
k=k*10+c-'0';
return k*f;
}
int n,m,t;
int s[5002][1002],a[5002][1002],ans[1002];
void solve(int line) {
int minid = 1,maxid = 0;
for(int k = 1; k<=t; k++) {
for(int i = k; i<=n; i++) {
for(int j = i-k+1; j<=i; j++) {
if(s[line][i]-s[line][j-1]>s[line][maxid]-s[line][minid-1]) {
maxid = i,minid = j;
} else if(s[line][i]-s[line][j-1]==s[line][maxid]-s[line][minid-1]) {
if(i-j>maxid-minid) {
maxid = i,minid = j;
}
}
}
}
}
if(minid==1&&maxid==0)return;
for(int i = minid; i<=maxid; i++) ans[i]++;
}
int main() {
n =read();
m = read();
t= read();
for(int i = 1; i<=m; i++) {
for(int j = 1; j<=n; j++) {
a[i][j] = read();
s[i][j] = s[i][j-1]+a[i][j];
}
}
for(int i = 1; i<=m; i++) solve(i);
for(int i = 1; i<=n; i++) cout<<ans[i]<<" ";
return 0;
}