#include <cstring>
#include <iostream>

using namespace std;

int main()
{
	int tc; cin>>tc;
	while(tc--){
		int gx,gy; cin>>gx>>gy;
		static int m[16][16][16][16];
		memset(m,0,sizeof m);
		int p; cin>>p;
		while(p--){
			int x1,y1,x2,y2; cin>>x1>>y1>>x2>>y2;
			m[x1][y1][x2][y2]=m[x2][y2][x1][y1]=1;
		}
		
		int dp[16][16]={};
		dp[0][0]=1;
		for(int i=0;i<=gx;i++)
			for(int j=0;j<=gy;j++){
				if(i && !m[i-1][j][i][j]) dp[i][j]+=dp[i-1][j];
				if(j && !m[i][j-1][i][j]) dp[i][j]+=dp[i][j-1];
			}
		
		if(!dp[gx][gy])
			cout<<"Miserable Hokusai!"<<endl;
		else
			cout<<dp[gx][gy]<<endl;
	}
	
	return 0;
}