#include <cstdio>
#include <cstring>

int mp[16][16];
int dp[16][16];
int n,p,gx,gy;

int main() {
	scanf("%d",&n);
	for(int i=0;i<n;i++) {
		scanf("%d %d",&gx,&gy);
		scanf("%d",&p);
		memset(mp,0,sizeof(mp));
		for(int i=0;i<p;i++) {
			int x1,y1,x2,y2;
			scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
			if(x1<x2) mp[x2][y2]|=2; else if(x1>x2) mp[x1][y1]|=2;
			if(y1<y2) mp[x2][y2]|=4; else if(y1>y2) mp[x1][y1]|=4;
		}
		memset(dp,0,sizeof(dp));
		dp[0][0]=1;
		for(int j=0;j<=gy;j++) {
			for(int i=0;i<=gx;i++) {
				if(!(mp[i][j]&2)&&(i-1)>=0) dp[i][j]+=dp[i-1][j];
				if(!(mp[i][j]&4)&&(j-1)>=0) dp[i][j]+=dp[i][j-1];
			}
		}
		if(dp[gx][gy]) printf("%d\n",dp[gx][gy]);
		else printf("Miserable Hokusai!\n");
	}
}