#include #include using namespace std; using namespace atcoder; using ll=long long; using ull=unsigned long long; using ld=long double; using i128=__int128; using P=pair; template using vc=vector; template using vv=vc>; using vl=vc; using vvl=vc>; using vul=vc; using vs=vc; using vb=vc; #define rep(i,s,n) for(ll i=s;i<(n);i++) #define Rep(i,s,n) for(ll i=n;i>=s;i--) #define nall(x) x.begin(),x.end() #define rall(a) a.rbegin(),a.rend() #define pb push_back #define eb emplace_back #define pob pop_back #define nexp(v) next_permutation(v) #define prep(v) prev_permutation(v) #define YES cout<<"Yes"<b)a=b;} void chmax(ll &a,ll b){if(a struct unsigned_type{ using type=make_unsigned_t; }; template<> struct unsigned_type<__int128>{ using type=unsigned __int128; }; template<> struct unsigned_type{ using type=unsigned __int128; }; template using unsigned_type_t=typename unsigned_type::type; template bool read(T &x){ int c=gc(); while(c!=EOF && c!='-' && (c<'0' || '9'; U y=0; while('0'<=c && c<='9'){ y=y*10+(c-'0'); c=gc(); } if constexpr(is_same_v){ if(neg){ if(y==0)x=0; else x=-(__int128)(y-1)-1; }else{ x=(__int128)y; } }else if constexpr(is_signed_v){ if(neg){ if(y==0)x=0; else x=-T(y-1)-1; }else{ x=T(y); } }else{ x=T(y); } return true; } bool read(string &s){ int c=gc(); while(c!=EOF && c<=' ')c=gc(); if(c==EOF)return false; s.clear(); while(c!=EOF && c>' '){ s+=char(c); c=gc(); } return true; } bool read(char &c){ int x=gc(); while(x!=EOF && x<=' ')x=gc(); if(x==EOF)return false; c=char(x); return true; } template bool read(T &x,Ts&... xs){ if(!read(x))return false; if constexpr(sizeof...(xs))return read(xs...); return true; } template void write(T x,char end='\n'){ using U=unsigned_type_t; U y; if constexpr(is_same_v){ if(x<0){ pc('-'); y=U(0)-U(x); }else{ y=U(x); } }else if constexpr(is_signed_v){ if(x<0){ pc('-'); y=U(0)-U(x); }else{ y=U(x); } }else{ y=U(x); } char s[64]; int n=0; do{ s[n++]=char('0'+y%10); y/=10; }while(y); while(n)pc(s[--n]); if(end)pc(end); } void write(const string &s,char end='\n'){ for(char c:s)pc(c); if(end)pc(end); } void write(const char *s,char end='\n'){ while(*s)pc(*s++); if(end)pc(end); } struct Flusher{ ~Flusher(){ flush(); } }flusher; } using fastio::read; using fastio::write; int main(){ ll h,w; read(h,w); vc s(h); uint32_t t=0; rep(i,0,h){ rep(j,0,w){ ull a; read(a); t+=a; s[i]+=a; } } rep(i,0,h)write(s[i]+t); }