class Route
  def initialize
    @grid = {}
  end

  def matatabi_set x1, y1, x2, y2
    m1 = make_key(x1, y1, x2, y2)
    m2 = make_key(x2, y2, x1, y1)
    @grid[m1] = true
    @grid[m2] = true
  end

  def ng? x1, y1, x2, y2
    @grid[make_key(x1, y1, x2, y2)]
  end

  def make_key x1, y1, x2, y2
    "#{x1.to_s(16)}#{y1.to_s(16)}#{x2.to_s(16)}#{y2.to_s(16)}"
  end
end

def main
  gets.chomp.to_i.times do
    gx,gy = gets.chomp.split.map(&:to_i)
    dp = Array.new(gy+1).map{Array.new(gx+1)}

    route = Route.new
    gets.chomp.to_i.times do
      x1, y1, x2, y2 = gets.chomp.split.map(&:to_i)
      route.matatabi_set(x1, y1, x2, y2)
    end

    dp[0][0] = 1
    (1..dp[0].size-1).each do |x|
      dp[0][x] = (route.ng?(x-1, 0, x, 0) ? 0 : dp[0][x-1])
    end
    (1..dp.size-1).each do |y|
      dp[y][0] = (route.ng?(0, y-1, 0, y) ? 0 : dp[y-1][0])
    end

    (1..dp[0].size-1).each do |x|
      (1..dp.size-1).each do |y|
        up = (route.ng?(x, y-1, x, y) ? 0 : dp[y-1][x])
        left = (route.ng?(x-1, y, x, y) ? 0 : dp[y][x-1])
        dp[y][x] = up + left
      end
    end

    puts (dp[gy][gx] == 0 ? 'Miserable Hokusai!' : dp[gy][gx])
  end
end

main