#include #include using namespace std; void trace(vector > &bd, int x, int y, int c, bool force) { if (x < 0 || y < 0 || x >= (int)bd.size() || y >= (int)bd.size()) return; if (bd[y][x] >= 0) { if (bd[y][x] & c) return; bd[y][x] |= c; } else if (!force) return; trace(bd, x-1, y, c, false); trace(bd, x, y-1, c, false); trace(bd, x+1, y, c, false); trace(bd, x, y+1, c, false); } int main() { int n, b, w, x, y; while ((cin >> n) && (n != 0) && (cin >> b >> w)) { vector > bd(n, vector(n, 0)); for (int i = 0; i < b; i++) { cin >> y >> x; bd[y-1][x-1] = -1; } for (int i = 0; i < w; i++) { cin >> y >> x; bd[y-1][x-1] = -2; } for (y = 0; y < n; y++) for (x = 0; x < n; x++) if (bd[y][x] == -1) trace(bd, x, y, 1, true); else if (bd[y][x] == -2) trace(bd, x, y, 2, true); int score = 0; for (y = 0; y < n; y++) for (x = 0; x < n; x++) score += (bd[y][x] == 1? 1 : bd[y][x] == 2? -1 : 0); if (score == 0) cout << "Draw" << endl; else if (score > 0) cout << "Black wins by " << score << endl; else cout << "White wins by " << (-score) << endl; } return 0; }