/* -*- coding: utf-8 -*- * * 351.cc: No.351 市松スライドパズル - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 1000000; /* typedef */ /* global variables */ char ops[MAX_N]; int ks[MAX_N]; /* subroutines */ /* main */ int main() { int h, w, n; cin >> h >> w >> n; for (int i = 0; i < n; i++) cin >> ops[i] >> ks[i]; int x = 0, y = 0; for (int i = n - 1; i >= 0; i--) { if (ops[i] == 'R') { if (ks[i] == y) x = (x + w - 1) % w; } else { if (ks[i] == x) y = (y + h - 1) % h; } //printf("%c %d: %d %d\n", ops[i], ks[i], x, y); } cout << (((x + y) & 1) ? "black" : "white") << endl; return 0; }