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