#include using namespace std; #define rep(i, a, b) for (ll i = a; i < b; i++) using ll = long long; int main(){ int h, w; cin >> h >> w; vector> a(h, vector(w)); rep(i, 0, h) rep(j, 0, w) cin >> a[i][j]; ll mod = 1LL << 32; vector s(h); ll t = 0; rep(i, 0, h) { rep(j, 0, w) s[i] += a[i][j]; s[i] %= mod; t += s[i]; } t %= mod; rep(i, 0, h) cout << (s[i] + t) % mod << endl; }