/* -*- coding: utf-8 -*- * * 3677.cc: No.3677 Global Checksum - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_H = 1000000; const int MAX_HW = 4000000; const long long MASK = (1LL << 32) - 1; /* typedef */ using ll = long long; /* global variables */ ll ss[MAX_H]; /* subroutines */ /* main */ int main() { int h, w; scanf("%d%d", &h, &w); int hw = h * w; ll t = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { int aij; scanf("%d", &aij); ss[i] += aij; } ss[i] &= MASK; t += ss[i]; } t &= MASK; for (int i = 0; i < h; i++) printf("%lld\n", (ss[i] + t) & MASK); return 0; }