#include #include #include using namespace std; char b[10000][10000]; int main(int argc, char *argv[]) { int H, W, N; cin >> H >> W >> 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) { string S; int K; cin >> 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; }