fn main() { let (h, w): (usize, usize) = { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( iter.next().unwrap().parse().unwrap(), iter.next().unwrap().parse().unwrap(), ) }; let mut c: Vec = vec![0; h]; let mut s:u32=0; for i in 0..h{ let A: Vec = { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.split_whitespace() .map(|x| x.parse().unwrap()) .collect() }; let mut x: u32 = 0; for &a in &A { x += a as u32; } c[i] = x; s=(s + x) } for i in 0..h{ println!("{}",s + c[i]); } }