use std::io::Read; fn run() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); let mut it = s.trim().split_whitespace(); let h: usize = it.next().unwrap().parse().unwrap(); let w: usize = it.next().unwrap().parse().unwrap(); let op = it.next().unwrap().chars().next().unwrap(); let b: Vec = (0..w).map(|_| it.next().unwrap().parse().unwrap()).collect(); let a: Vec = (0..h).map(|_| it.next().unwrap().parse().unwrap()).collect(); let mut ans = String::new(); for a in a { for b in b.iter() { let v = if op == '+' {a + *b} else {a * *b}; ans.push_str(&format!("{} ", v)); } ans.pop(); ans.push('\n'); } print!("{}", ans); } fn main() { run(); }