@dir = [[0, 0, 1], [0, 1, 0], [1, 0, 0],
  [0, 1, 1], [0, 1, -1], [1, 0, 1], [1, 0, -1], [1, 1, 0], [1, -1, 0],
  [1, 1, 1], [1, 1, -1], [1, -1, -1], [1, -1, 1]]

def out(dir, x, y, z, n, j)
  dir.zip([x, y, z]).any?{ |a, b| n <= a * j + b || a * j + b < 0 }
end

def check(balls, ok, n, m, turn)
  n.times do |x|
    n.times do |y|
      n.times do |z|
        if balls[x][y][z] == turn
          13.times do |i|
            if ok[turn][x][y][z][i]
              is_ok = true
              m.times do |j|
                if out(@dir[i], x, y, z, n, j)
                  is_ok = false
                  break
                end
                space = balls[x + @dir[i][0] * j][y + @dir[i][1] * j][z + @dir[i][2] * j]
                if !space
                  is_ok = false
                elsif space == 1 - turn
                  (0..j).each do |k|
                    ok[turn][x + @dir[i][0] * k][y + @dir[i][1] * k][z + @dir[i][2] * k][i] = false
                  end
                  is_ok = false
                  break
                end
              end
              return true if is_ok
            end
          end
        end
      end
    end
  end
  false
end

loop do
  n, m, p = gets.split.map(&:to_i)
  break if n == 0
  z_plane = n.times.map{ [0] * n }
  fin = false
  balls = n.times.map{ n.times.map{ [false] * n } }
  ok = 2.times.map{ n.times.map{ n.times.map{ n.times.map { [true] * 13 } } } }
  p.times do |i|
    x, y = gets.split.map(&:to_i)
    next if fin
    z = (z_plane[y - 1][x - 1] += 1)
    balls[x - 1][y - 1][z - 1] = i % 2
    if check(balls, ok, n, m, i % 2)
      printf "%s %d\n" % [['Black', 'White'][i % 2], i + 1]
      fin = true
    end
  end
  puts 'Draw' unless fin
end