#include #define int long long //#define USE_FREOPEN //#define MUL_TEST #define FILENAME "puzzle" using namespace std; char op[1000005]; int k[1000005]; void solve() { int h,w; cin >> h >> w; int n; cin >> n; int r = 0,c = 0; for (int i = 1; i <= n; i++) { cin >> op[i] >> k[i]; } for (int i = n; i >= 1; i--) { if (op[i] == 'R' && r == k[i]) c = (c - 1 + w) % w; else if (op[i] == 'C' && c == k[i]) r = (r - 1 + h) % h; } cout << (((r + c) % 2 == 1) ? "black\n" : "white\n"); } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #ifdef USE_FREOPEN freopen(FILENAME ".in","r",stdin); freopen(FILENAME ".out","w",stdout); #endif int _ = 1; #ifdef MUL_TEST cin >> _; #endif while (_--) solve(); _^=_; return 0^_^0; }