#include using namespace std; using uint=unsigned int; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n,m; cin >> n >> m; { string dum; getline(cin,dum); } vector> v(n,vector(m,0)); vector w; uint t=0; string s; for(auto &nx : v){ uint c=0; getline(cin,s); int pos=0; s.push_back(' '); for(auto &ny : nx){ while(s[pos]!=' '){ ny*=10; ny+=(s[pos]-'0'); pos++; } c+=ny; pos++; } t+=c; w.push_back(c); } for(auto &nx : w){ cout << (nx+t) << "\n"; } return 0; }