#include <stdio.h>
#include <stdlib.h>
#define min(a,b) (((a) < (b)) ? (a) : (b))

int main(void ){
	int dataset;

	scanf("%d", &dataset);
	while(dataset--){
		int gx, gy;
		int matatabis;
		int road[16][16];
		int matatabi[16][16];
		int x, y;
		memset(road, 0, sizeof(road));
		memset(matatabi, 3, sizeof(matatabi));

		scanf("%d %d", &gx, &gy);
		scanf("%d", &matatabis);
		while(matatabis--){
			int x1, y1, x2, y2;
			scanf("%d %d %d %d", &x1, &y2, &x2, &y2);
			if (x1==x2) matatabi[x1][min(y1, y2)] -= 1;
			else matatabi[min(x1, x2)][y1] -= 2;
		}

		road[1][1] = 1;
		for (x=1; x<=gx+1; x++){
			for (y=1; y<=gy+1; y++){
				if (x-1){
					if (matatabi[x-1][y] & 2) road[x][y] += road[x-1][y];
				}
				if (y-1){
					if (matatabi[x][y-1] & 1) road[x][y] += road[x][y-1];
				}
			}
		}
		if (road[gx+1][gy+1]) printf("%d\n", road[gx+1][gy+1]);
		else printf("Miserable Hokusai!");
	}
}

/*
1	ª
2	¨
*/