use std::cmp::*; use std::io::*; fn getline() -> String { let mut ret = String::new(); std::io::stdin().read_line(&mut ret).ok(); return ret; } fn getword() -> String { let mut stdin = std::io::stdin(); loop { let mut buf: Vec = Vec::new(); let mut u8b: [u8; 1] = [0]; loop { stdin.read(&mut u8b); if u8b[0] <= ' ' as u8 { break; } else { buf.push(u8b[0]); } } let ret = std::string::String::from_utf8(buf).unwrap(); if ret.len() >= 1 { return ret; } } } fn parse(s : &str) -> T { match s.parse::() { Ok(t) => t, _ => panic!(), } } fn main() { let h: i32 = parse(&getword()); let w: i32 = parse(&getword()); let n: usize = parse(&getword()); let mut s = vec![' '; n]; let mut k = vec![0; n]; let mut x = 0; let mut y = 0; for i in 0 .. n { s[i] = getword().chars().nth(0).unwrap(); k[i] = parse(&getword()); } for i in (0 .. n).rev() { match s[i] { 'R' => if y == k[i] { x = (x + w - 1) % w }, 'C' => if x == k[i] { y = (y + h - 1) % h }, _ => panic!(), }; } println!("{}", if (x + y) % 2 == 0 { "white" } else { "black" }); }