#include <iostream>
#include <fstream>
using namespace std;
ifstream f("var25.in");
ofstream g("var25.out");
int n, m, i, j, s[1000], num;
void suma(int num, int j, int s[])
{
s[j]=s[j]+num;
}
int main()
{
f >> n >> m;
for (i=1; i<=n; ++i)
{
for (j=1; j<=m; ++j)
{
f >> num;
if (num>0) suma(num,j,s);
}
}
for (j=1; j<=m; ++j)
g << s[j] << " ";
}