using System; public class Program { public static void Main() { int[] size = Array.ConvertAll(Console.ReadLine().Split(), value => int.Parse(value)); bool[,] isWhite = new bool[size[0], size[1]]; for (int i = 0; i < size[0]; i++) { for (int j = 0; j < size[1]; j++) { isWhite[i, j] = ((i+j)&1) == 0; } } int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { string[] move = Console.ReadLine().Split(); int line = int.Parse(move[1]); if (move[0] == "C") { bool[] temp = new bool[size[0]]; for (int j = 0; j < size[0]; j++) { temp[j] = isWhite[j, line]; } for (int j = 0; j < size[0]; j++) { isWhite[(j+1)%size[0], line] = temp[j]; } } else { bool[] temp = new bool[size[1]]; for (int j = 0; j < size[1]; j++) { temp[j] = isWhite[line, j]; } for (int j = 0; j < size[1]; j++) { isWhite[line, (j+1)%size[1]] = temp[j]; } } } Console.WriteLine(isWhite[0, 0] ? "white" : "black"); } }