#include #include #include using namespace std; char b[10000][10000]; int main(int argc, char *argv[]) { int H, W, N; scanf("%d %d", &H, &W); scanf("%d", &N); for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { b[i][j] = (i + j) % 2; } } for (int i = 0; i < N; ++i) { char S[64]; int K; scanf("%s %d", S, &K); if (S[0] == 'C') { char c = b[H - 1][K]; for (int j = 1; j < H; ++j) { b[j][K] = b[j - 1][K]; } b[0][K] = c; } else { char c = b[K][W - 1]; memmove(&(b[K][1]), &(b[K][0]), W - 1); b[K][0] = c; } } cout << (b[0][0] ? "black" : "white") << endl; return 0; }