#include <stdio.h>
int disabled_route[16][16];

int main(void){
	int dataset;
	scanf("%d", &dataset);

	while(dataset--){
		int gx, gy, matatabi;
		int x1, y1, x2, y2;
		int foo;
		for(x1=0;x1<16;x1++)
		for(y1=0;y1<16;y1++)
		disabled_route[x1][y1] = 0;

		scanf("%d", &gx);
		scanf("%d", &gy);
		scanf("%d", &matatabi);

		while(matatabi--){
			scanf("%d", &x1);
			scanf("%d", &y1);
			scanf("%d", &x2);
			scanf("%d", &y2);
			if(x1 > x2) {
				foo = x1;
				x1 = x2;
				x2 = foo;
			}else if(y1 >y2) {
				foo = y1;
				y1 = y2;
				y2 = foo;
			}
			disabled_route[x2][y2] += ( x1==x2 ? 1 : 2 );
		}

		if(foo = count(gx, gy)) printf("%d\n", foo);
		else printf("Miserable Hokusai!\n");
	}

	return 0;
}

int count(x, y){
	if(x==0 && y==0) return 1;
	switch(disabled_route[x][y]){
	  case 3:
		return 0;
	  case 2:
		return y ? count(x, y-1) : 0;
	  case 1:
		return x ? count(x-1, y) : 0;
	  case 0:
		return (y ? count(x, y-1) : 0) + (x ? count(x-1, y) : 0);
	}
}

/* note
1	vertical
2	horizontal
*/