#include <iostream>
#include <algorithm>
#include <cstdio>
#include <math.h>
using namespace std;

int gx,gy,p,x,z,y,w,a[16][16],sw=0,n;

int main(){
	cin>>n;for(int k=0;k<n;k++){
	while(cin>>gx>>gy>>p){
		int h[16][16]={0},v[16][16]={0};
		for(int i=0;i<p;i++){
			cin>>x>>y>>z>>w;
			if(x==z){int M=max(y,w); v[x][M]=1;}
			else {int M=max(x,z); h[M][y]=1;}
		}
		for(int i=0;i<=max(gx,gy);i++){v[i][0]=1;h[0][i]=1;}
		for(int i=0;i<=gx;i++){
			for(int j=0;j<=gy;j++){
				if(v[i][j]==0&&h[i][j]==0)a[i][j]=a[i-1][j]+a[i][j-1];
				else if(v[i][j]==0)a[i][j]=a[i][j-1];
				else if(h[i][j]==0)a[i][j]=a[i-1][j];
				else {
					if(i==0&&j==0)a[i][j]=1;
					else a[i][j]=0;
				}
			}
		}
		if(a[gx][gy]>0)cout<<a[gx][gy]<<endl;
		else cout<<"Miserable Hokusai!"<<endl;
		sw=1;
	}
	}
}