use std::io::*; use std::str::FromStr; #[allow(dead_code)] fn get_line() -> String { let stdin = stdin(); let mut line = String::new(); stdin.lock().read_line(&mut line).expect("io error."); line.trim().to_string() } #[allow(dead_code)] fn get_word() -> T { (&get_line()).parse().ok().expect("parse error.") } #[allow(dead_code)] fn get_vec() -> Vec { (&get_line()).split(' ').map(|x| x.parse().ok().expect("parse error.")).collect() } fn main() { let color: Vec = "BW".chars().collect(); let v = get_vec::(); let w: u64 = (&v[0]).parse().ok().unwrap(); let h: u64 = (&v[1]).parse().ok().unwrap(); let c: u64 = if v[2].chars().next().unwrap() == 'B' {0} else {1}; for i in 0..h { for j in 0..w { print!("{}", color[((i + j + c) % 2) as usize]); } println!(""); } }