#include #include #include using namespace std; #define mod 998244353 #define YES cout << "YES" < #define ld long double #define OO 1e18 #define UOO 18446744073709551615 #define INF 0x3f3f3f3f #define PANIC_ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define IO freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #define forn for (ll i =0; i #define vint vector #define vll vector #define vpll vector #define vchar vector #define vstring vector #define dll deque #define el "\n" #define wide5 setw(5) << setiosflags(ios::right) #define popCnt(x) (__builtin_popcountll(x)) const ll MAX = 2e5 + 5, MOD = 1e9 + 7, N = 2e5 + 5; const int dx[] = { -1, -1, 0, -1, 1, 1, 0, 1 }; const int dy[] = { 0, -1, -1, 1, 0, 1, 1, -1 }; ll fast_pow(ll a, ll p) { int res = 1; while (p) { if (p % 2 == 0) { a = a * 1ll * a % mod; p /= 2; } else { res = res * 1ll * a % mod; p--; } } return res; } ull gcd(ull a, ull b) { if (b == 0) return a; return gcd(b, a % b); } ull lcm(ull a, ull b) { return (a / gcd(a, b)) * b; } ull f(ull a) { return (a * (a + 1)) / 2; } bool isPalindrome(string S) { string P = S; reverse(P.begin(), P.end()); if (S == P)return true; return false; } ull factorial(ull n) { ull f; for (f = 1; n > 1; n--) f = f * n % MOD; return f; } ull npr(ull n, ull r) { return factorial(n) / factorial(n - r); } ull ncr(ull n, ull r) { ll p = 1, k = 1; if (n - r < r) r = n - r; if (r != 0) { while (r) { p *= n; k *= r; ll m = gcd(p, k); p /= m; k /= m; n--; r--; } } else p = 1; return p; } ull countOdd(ull L, ull R) { ull N = (R - L) / 2; if (R % 2 || L % 2) N += 1; return N; } bool is_prime(ll n) { if (n <= 1)return false; if (n <= 3)return true; if (n % 2 == 0 || n % 3 == 0)return false; for (ll i = 5; i * i <= n; i += 6) { if (n % i == 0 || n % (i + 2) == 0)return false; } return true; } ll countDivisibles(ll A, ll B, ll M) { if (A % M == 0) return (B / M) - (A / M) + 1; return (B / M) - (A / M); } ll countDivisiblesByTwoNumbers(ll N, ll A, ll B) { return ceil((N / lcm(A, B))); } bool checkifdivisable(string& n, ll k) { ll rem = 0; for (auto i : n) { rem = ((rem * 10) + i - '0') % k; } return rem == 0; } string lower(string s) { for (int i = 0; i < s.length(); i++)s[i] = tolower(s[i]); return s; } string upper(string s) { for (int i = 0; i < s.length(); i++)s[i] = toupper(s[i]); return s; } bool is_overlapping(ll x1, ll x2, ll y1, ll y2) { return (max(x1, y1) < min(x2, y2)); } ll digit(ll n) { return floor(log10(n) + 1); } vector primeFactors(ll n) { vll arr; //setarr; while (n % 2 == 0) { //arr.insert(2); arr.push_back(2); n = n / 2; } for (int i = 3; i * i <= n; i = i + 2) { while (n % i == 0) { //arr.insert(i); arr.push_back(i); n = n / i; } } //if (n > 2)arr.insert(n); if (n > 2)arr.push_back(n); return arr; } double sumpow(double n, double p) { return pow(n, p + 1) - 1; } bool sa7e7(ld n) { return (ceil(n) == floor(n)); } set getDivisors(ll n) { //vll dv; setst; int cnt = 0; for (int i = 1; i * i <= n; i++) { if (n % i == 0) { //dv.push_back(i); st.insert(i); if (n % (n / i) == 0) { //dv.push_back(n / i); st.insert(n / i); } } } //return dv; return st; } ll convert(ll m, ll n) { if (m == n)return 0; if (m > n)return m - n; if (n % 3 != 0)return 1 + convert(m, n + 1); else return 1 + convert(m, n / 3); } ll removeBit(ll mask, ll bit) { return mask & ~(1ll << bit); } ll addBit(ll mask, ll bit) { return mask | (1ll << bit); } string getString(char x) { string s(1, x); return s; } bool perfect_square(ll n) { ll x = sqrt(n); return (x * x == n); } ll cnt2(ll n) { ll x = 0; while (n % 2 == 0) { x++; n /= 2; } return x; } bool pow2(ll n) { return !n || !(n - 1 & n); } ll sum_digit(ll n) { string s = to_string(n); ll sum = 0; for (int i = 0; i < s.length(); i++)sum += (s[i] - '0'); return sum; } ld log_a_to_base_b(ld a, ld b) { return (ld)((ld)log2(a) / (ld)log2(b)); } ll B2D(string s) { reverse(all(s)); ll sum = 0; for (int i = 0; i < min((ll)s.length(), 32LL); i++) { if (s[i] == '1')sum += pow(2, i); } return sum; } string D2B(ll n) { ll binaryNum[32]; ll i = 0; while (n > 0) { binaryNum[i] = n % 2; n = n / 2; i++; } string s = ""; for (int j = i - 1; j >= 0; j--) s += (char)(binaryNum[j] + '0'); return s; } ll mul(ll a, ll b) { return ((a % MOD) * (b % MOD)) % MOD; } ll add(ll a, ll b) { return ((a % MOD) + (b % MOD)) % MOD; } ll sub(ll a, ll b) { return ((a % MOD) - (b % MOD)) % MOD; } ll fstpow(ll b, ll p) { if (p == 0)return 1; if (p == 1)return b; ll hp = fstpow(b, p / 2); ll ans = mul(hp, hp); if (p % 2)ans = mul(ans, b); return ans % mod; } //******************************************************************* bool outsideTheRange(ll x, ll l, ll r) { return x < l || x > r; } void Do_ur_job() { ll r, c; cin >> r >> c; vll v(r); ll tot = 0; ll md = (1LL << 32); for (int i = 0; i < r; i++) { ll sumR = 0; for (int j = 0; j < c; j++) { ll x; cin >> x; x %= md; sumR += x % md; sumR %= md; } tot += sumR % md; tot %= md; v[i] = sumR % md; } for (int i = 0; i < r; i++) { cout << (v[i] % md + tot % md) % md << el; } } int main() { //IO PANIC_;; ll t = 1; // cin >> t; for (ll i = 0; i < t; i++)Do_ur_job(); return 0; }