gets.to_i.times do
  gx, gy = gets.split.map(&:to_i)
  vine = Array.new(gx+2) {Array.new(gy+2) {Array.new(gx+2) {Array.new(gy+2, false)}}}
  p = gets.to_i
  p.times do
    x1, y1, x2, y2 = gets.split.map(&:to_i)
    vine[x1+1][y1+1][x2+1][y2+1] = vine[x2+1][y2+1][x1+1][y1+1] = true
  end
  dp = Array.new(gx+2) {Array.new(gy+2, 0)}
  dp[1][1] = 1
  for i in 0..gx do
    for j in 0..gy do
      dp[i+1][j+1] += dp[i][j+1] if !vine[i][j+1][i+1][j+1]
      dp[i+1][j+1] += dp[i+1][j] if !vine[i+1][j][i+1][j+1]
    end
  end
  puts dp[gx+1][gy+1] != 0 ? dp[gx+1][gy+1] : "Miserable Hokusai!"
end