#include #include #include int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::uint32_t h, w; std::cin >> h >> w; std::vector sums(h); std::uint32_t total = 0; for (auto& s : sums) { s = 0; for (std::uint32_t j=0,x;j> x; s += x; } total += s; } for (auto s : sums) std::cout << std::uint32_t(s + total) << '\n'; }