#include #include using namespace std; using namespace atcoder; using ll=long long; using ull=unsigned long long; using ld=long double; using i128=__int128; using P=pair; template using vc=vector; template using vv=vc>; using vl=vc; using vvl=vc>; using vul=vc; using vs=vc; using vb=vc; #define rep(i,s,n) for(ll i=s;i<(n);i++) #define Rep(i,s,n) for(ll i=n;i>=s;i--) #define nall(x) x.begin(),x.end() #define rall(a) a.rbegin(),a.rend() #define pb push_back #define eb emplace_back #define pob pop_back #define nexp(v) next_permutation(v) #define prep(v) prev_permutation(v) #define YES cout<<"Yes"<b)a=b;} void chmax(ll &a,ll b){if(a> h >> w; vvl a(h,vl(w)); vl s(h),c(h); ll t=0; rep(i,0,h){ rep(j,0,w){ cin >> a[i][j]; t=(t+a[i][j])%mod; s[i]=(s[i]+a[i][j])%mod; } } rep(i,0,h)cout << (s[i]+t)%mod << endl; }