#include #define rep(i,a,b) for(int i=int(a);i> H >> W >> N; vector S(N); vector K(N); rep(i,0,N){ cin >> S[i] >> K[i]; } int x = 0, y = 0; rep(i,0,N){ int j = N - i - 1; if(S[j] == 'C' && K[j] == x){ y = (y - 1 + H) % H; } if(S[j] == 'R' && K[j] == y){ x = (x - 1 + W) % W; } } cout << y << " " << x << endl; cout << ( (x + y) % 2 ? "black" : "white" )<< endl; }