#include <iostream>
#include <queue>
#include <map>
using namespace std;
int main(){
	int t,data[16][16],flag[16][16];
	for(cin>>t;t>0;t--){
		int x,y,n,x1,y1,x2,y2;
		cin>>x>>y;
		for(int i=0;i<=y;i++)for(int j=0;j<=x;j++)flag[j][i]=data[j][i]=0;
		data[x][y]=1;
		queue<int>X;
		queue<int>Y;
		X.push(x);
		Y.push(y);
		map<int,int>out;
		for(cin>>n;n>0;n--){
			cin>>x1>>y1>>x2>>y2;
			out[x1*1000000+y1*10000+x2*100+y2]=1;
			out[x2*1000000+y2*10000+x1*100+y1]=1;
		}
		while(X.empty()==0){
			x=X.front();
			y=Y.front();
			if(flag[x][y]==0){
				flag[x][y]=1;
				if(y>0)if(out[x*1000000+y*10000+x*100+y-1]==0)data[x][y-1]+=data[x][y],X.push(x),Y.push(y-1);
				if(x>0)if(out[x*1000000+y*10000+(x-1)*100+y]==0)data[x-1][y]+=data[x][y],X.push(x-1),Y.push(y);
			}
			X.pop();
			Y.pop();
		}
		if(data[0][0]==0)cout<<"Miserable Hokusai!"<<endl;
		else cout<<data[0][0]<<endl;
	}
	return 0;
}
