#include #include #include #include using namespace std; int main() { int h, w, n; cin >> h >> w >> n; vector > operations; for (int i = 0; i < n; ++i) { string s; int k; cin >> s >> k; operations.push_back(make_pair(s[0], k)); } int x = 0; int y = 0; for (int i = operations.size() - 1; i >= 0; --i) { if (operations[i].first == 'R') { if (operations[i].second == y) { --x; if (x < 0) { x = w - 1; } } } else { if (operations[i].second == x) { --y; if (y < 0) { y = h - 1; } } } } cout << ((x + y) % 2 == 0 ? "white" : "black") << endl; return 0; }