
$g=[]
$mat=[]

def ans(x,y)
  if(x>$g[0][0]|| y>$g[0][1])
    return 0
  elsif x==0 && y== 0
    return 1
  end
  flag1 = true
  flag2 = true
  sum = 0

  $mat.each{|m|
    if (m[2]==x && m[3]==y)&& m[0]==x then
      flag1=false
    end
    if(m[2]==x && m[3]==y)&& m[1]==y then
      flag2=false
    end
  }
  if flag1 && flag2 then
    return ans(x,y-1)+ans(x-1,y)
  elsif flag1 then
    return ans(x-1,y)
  else
    return ans(x,y-1)
  end

  return 0



end

dataset = gets.to_i
dataset.times{
  gx, gy = gets.split(" ").map(&:to_i)
  $g << [gx,gy]
  matatabi = gets.to_i
  (0..matatabi-1).each{|i|
    x1,y1, x2,y2 = gets.split(" ").map(&:to_i)
    $mat << [ x1 , y1 , x2 , y2 ]
  }
  puts (ans($g[0][0],$g[0][1])? ? "Miserable Hokusai!": ans($g[0][0],$g[0][1]))

}