gets.to_i.times do
  gx,gy = gets.split(" ").map{|s| s.to_i}
  ngx,ngy = [],[]
  gets.to_i.times do
    a = gets.split(" ").map{|s| s.to_i}
    if a[0] == a[2]
      ngy << [a[0],[a[1],a[3]].max]
    else
      ngx << [[a[0],a[2]].max,a[1]]
    end
  end
    
  ptn = Array.new(gy+1){Array.new(gx+1)}
  ptn[0][0] = 1

  for x in 1..gx
    ptn[0][x] = (ngx.include?([x,0]) ? 0 : ptn[0][x-1])
  end
  for y in 1..gy
    ptn[y][0] = (ngy.include?([0,y]) ? 0 : ptn[y-1][0])
    for x in 1..gx
      ptn[y][x] = (ngx.include?([x,y]) ? 0 : ptn[y][x-1]) + (ngy.include?([x,y]) ? 0 : ptn[y-1][x])
    end
  end

  puts (ptn[gy][gx] == 0 ? "Miserable Hokusai!" : ptn[gy][gx])
end