#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int h, w; cin >> h >> w; vector S(h); uint32_t tot = 0, v; for(int y = 0; y < h; y++){ for(int x = 0; x < w; x++){ cin >> v; S[y] += v; } tot += S[y]; } for(auto &&v : S) cout << tot + v << '\n'; }