#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) template inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); } template inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); } typedef long long ll; int const inf = 1<<29; int main() { int H, W; cin >> H >> W; int N; cin >> N; vector> v; rep(i, N) { char c; int k; cin >> c >> k; v.emplace_back(c == 'R', k); } int sx = 0, sy = 0; rep(i, N) { bool op = v[N-i-1].first; int num = v[N-i-1].second; if(op) { if(num == sy) { sx --; if(sx < 0) sx = W-1; } } else { if(num == sx) { sy --; if(sy < 0) sy = H-1; } } } /* vector> w(H, vector(W)); w[0][0] = 1; REP(i, 1, W) w[0][i] = !w[0][i-1]; REP(i, 1, H) rep(j, W) { w[i][j] = !w[i-1][j]; } */ cout << ((sx + sy) % 2 == 0 ? "white" : "black") << endl; return 0; }