require 'pp'

#pp $t

def init()
	$t = Array.new(17).map{Array.new(17, 0)}
	$t[1][1] = 1
	$vert = Array.new(17).map{Array.new(17, true)}
	$horiz = Array.new(17).map{Array.new(17, true)}
end

def input_matatabi()
	a = gets.chomp.split(" ").map{|str| str.to_i}
	if a[0] == a[2]
		$vert[a[0] + 1][[a[1], a[3]].min + 1] = false
	else
		$horiz[[a[0], a[2]].min + 1][a[1] + 1] = false
	end
end

def calc_t()
	for i in 1..16
		for j in 1..16
			if $vert[i][j - 1]
				$t[i][j] += $t[i][j - 1]
			end
			if $horiz[i - 1][j]
				$t[i][j] += $t[i - 1][j]
			end
		end
	end
end

n = gets.chomp.to_i

n.times do
	init()

	gx, gy = gets.chomp.split(" ").map{|str| str.to_i}
	num_matatabi = gets.chomp.to_i

	num_matatabi.times do
		input_matatabi
	end

	calc_t()

	if ($t[gx + 1][gy + 1] == 0)
		puts "Miserable Hokusai!"
	else
		puts $t[gx + 1][gy + 1]
	end

#	pp $vert.map{|a| a.map{|value| value ? 0 : 1}}
#	pp $horiz.map{|a| a.map{|value| value ? 0 : 1}}
#	pp $t
end