use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let m: usize = itr.next().unwrap().parse().unwrap(); let op: char = itr.next().unwrap().parse().unwrap(); let b: Vec = (0..m) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let a: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut c = vec![vec![0; 100]; 100]; for i in 0..n { for j in 0..m { if op == '*' { c[i][j] = a[i] * b[j]; } else { c[i][j] = a[i] + b[j]; } } } for i in 0..n { for j in 0..m { print!("{}", c[i][j]); if j != m - 1 { print!(" ",); } } println!("",); } }