#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rt return #define FOR(i,j,k) for(int i=j; i<(int)k;++i) #define rep(i,j) for(int i=0;i<(int)j;++i) #define rep1(i,j) for(int i=1;i<=(int)j;++i) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define mt make_tuple #define pb_ push_back #define eb_ emplace_back #define fi_ first #define se_ second #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; const int MX = 1000099; int H, W, N, K[MX]; char S[MX][2]; int main(){ ios::sync_with_stdio(0); cin.tie(0); while(cin >> H >> W >> N){ rep(i, N){ cin >> S[i] >> K[i]; } int y = 0, x = 0; for(int i = N - 1; i >= 0; --i){ if(S[i] == "R"){ if(x == K[i]){ x = (W + y - 1) % W; } } else{ if(y == K[i]){ y = (H + y - 1) % H; } } } cout << ((x + y) & 1 ? "black" : "white") << endl; } }