// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #include #include #include using namespace std; using namespace __gnu_pbds; // #include // using mint = atcoder::modint998244353; using ll = long long; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) // const ll dy[] = {-1, -1, -1, 0, 0, 1, 1, 1}; // const ll dx[] = {-1, 0, 1, -1, 1, -1, 0, 1}; const ll dy[] = {-1, 0, 0, 1}; const ll dx[] = {0, -1, 1, 0}; template bool isrange(T target, T1 low, T2 high) { return low <= target && target < high; } template T min(const T &t, const U &u) { return t < u ? t : u; } template T max(const T &t, const U &u) { return t < u ? u : t; } template bool chmin(T &t, const U &u) { if (t > u) { t = u; return true; } return false; } template bool chmax(T &t, const U &u) { if (t < u) { t = u; return true; } return false; } template using hash_map = gp_hash_table; template using hash_set = gp_hash_table; // #include "titan_cpplib/others/io.cpp" // #include "titan_cpplib/others/print.cpp" void solve() { const ll mod = 1ll << 32; int h, w; cin >> h >> w; vector> A(h, vector(w)); rep(i, h) rep(j, w) cin >> A[i][j]; vector S(h); rep(i, h) { rep(j, w) { S[i] += A[i][j]; S[i] %= mod; } } ll T = 0; rep(i, h) { T += S[i]; T %= mod; } rep(i, h) { cout << (S[i]+T) % mod << "\n"; } } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); cerr << fixed << setprecision(15); int t = 1; // cin >> t; for (int i = 0; i < t; ++i) { solve(); } return 0; }