h,w=gets.split.map(&:to_i) x=y=0 operations=gets.to_i.times.map{gets.split} operations.reverse.each{|c,k| if c==?R y=(y-1)%w if k.to_i==x else x=(x-1)%h if k.to_i==y end } puts (x+y).odd? ? "black" : "white"