#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> H >> W; vector> a(H, vector(W)); REP(i,H) REP(j,W) cin >> a[i][j]; ll MOD=1LL<<32; vector v(H); ll T=0; REP(i,H){ ll s=0; REP(j,W){ s+=a[i][j]; } s%=MOD; v[i]=s; T+=s; T%=MOD; } REP(i,H) cout << (v[i]+T)%MOD << endl; return 0; }