#include <iostream>
#include <cstdio>

using namespace std;

int main(){
  int n;
  long long dp[20][20];
  int mt[20][20][20][20];

  cin >> n;
  for(int k=0;k<n;k++){
    int gx,gy;
    cin >> gx >> gy;
    for(int i=0;i<=gy;i++)
      for(int j=0;j<=gx;j++)
	dp[i][j] = 0;

    for(int i=0;i<=gy;i++)
      for(int j=0;j<=gx;j++)
	for(int n=0;n<=gy;n++)
	  for(int m=0;m<=gx;m++)
	    mt[j][i][m][n] = 0;
	
    int mata;
    cin >> mata;
    for(int i=0;i<mata;i++){
      int x1,y1,x2,y2;
      cin >> x1 >> y1 >> x2 >> y2;
      mt[x1][y1][x2][y2] = 1;
      mt[x2][y2][x1][y1] = 1;
    }
    dp[0][0] = 1;
    for(int i=0;i<=gy;i++){
      for(int j=0;j<=gx;j++){
	if(i-1<0 || mt[j][i-1][j][i] || dp[i-1][j]==0){
	  if(j-1<0 || mt[j-1][i][j][i] || dp[i][j-1]==0){
	    continue;
	  }
	  else dp[i][j] = dp[i][j-1];
	}
	else if(j-1<0 || mt[j-1][i][j][i] || dp[i][j-1]==0){
	  dp[i][j] = dp[i-1][j];
	}
	else dp[i][j] = dp[i-1][j]+dp[i][j-1];
      }
    }
    if(dp[gy][gx] == 0) printf("Miserable Hokusai!\n");
    else printf("%d\n",dp[gy][gx]);
  }
  return 0;
}