#include #include #include using namespace std; #define rep(i,a,b) for(int i=a;i &v, int w) { rep(i, 0, w) v[i] ? v[i]=0 : v[i]=1; } void row_s(vector &v, int w) { int i, tmp = v[w - 1]; for (i = w - 1; i > 0; i--) v[i] = v[i - 1]; v[0] = tmp; } void col_s(vector > &vv, int h, int t) { int i, tmp = vv[h - 1][t]; for (i = h - 1; i > 0; i--) vv[i][t] = vv[i - 1][t]; vv[0][t] = tmp; } int main(void) { int i, j, h, w, n, k; char s; cin >> h >> w >> n; vector > vv; vector v = { 1 }; rep(i, 1, w) v[i - 1] ? v.pb(0) : v.pb(1); vv.pb(v); rep(i, 1, h) { row_r(v, w); vv.pb(v); } // for (auto i : vv) { for (auto j : i) cout << j << " "; cout << endl; } rep(i, 0, n) { cin >> s >> k; (s == 'R') ? row_s(vv[k], w) : col_s(vv, h, k); } // for (auto i : vv) { for (auto j : i) cout << j << " "; cout << endl; } (vv[0][0]) ? printf("white\n") : printf("black\n"); return 0; }