n = gets.to_i
n.times do
  gx, gy = gets.split.map(&:to_i)
  k = gets.to_i
  forbidden = {}
  k.times do
    x1, y1, x2, y2 = gets.split.map(&:to_i)
    x1, y1, x2, y2 = x2, y2, x1, y1 if x2 + y2 < x1 + y1
    forbidden[[x1, y1, x2, y2]] = 1
  end
  a = (0..gx+1).map {(0..gy+1).map { 0 } }
  a[0][0] = 1
  (0..gx).each do |x|
    (0..gy).each do |y|
      a[x+1][y] += a[x][y] unless forbidden[[x, y, x+1, y]]
      a[x][y+1] += a[x][y] unless forbidden[[x, y, x, y+1]]
    end
  end
  puts a[gx][gy] == 0 ? 'Miserable Hokusai!' : a[gx][gy]
end
