#include<iostream>
using namespace std;
int a[20][20],b[30],i,j,n,m;
int main()
{
cout<<"m=";cin>>m;
cout<<"n=";cin>>n;
for(i=0;i<=m-1;i++)
for(j=0;j<=n-1;j++)
{
cout<<"a["<<i<<"]["<<j<<"]=";
cin>>a[i][j];
}
for(i=0;i<=m-1;i++)
b[i]=0;
for(i=0;i<=m-1;i++)
for(j=0;j<=n-1;j++)
b[i]=b[i]+a[i][j];
for(i=0;i<=m-1;i++)
cout<<b[i]<<" ";
}