#include<iostream>
using namespace std;

int kitasatoshibasaburou;
int u[20][20];
int o[20][20]={};
int tate;
int yoko;
int ushi;
int a[101];
int b[101];
int c[101];
int d[101];
int main(){
  cin>>kitasatoshibasaburou;
    for(int i=0;i<kitasatoshibasaburou;i++){
      cin>>tate>>yoko>>ushi;
      for(int j=0;j<ushi;j++){
	cin>>a[j]>>b[j]>>c[j]>>d[j];
      }
      u[0][0]=1;
      for(int k=0;k<tate+1;k++){
	for(int l=0;l<yoko+1;l++){
	  for(int m=0;m<ushi;m++){
	    if(k==a[m]&&k==c[m]&&(b[m]==l||d[m]==l)&&(b[m]==l+1||d[m]==l+1)){
	      o[k][l]=o[k][l]+1;
	    }if(l==b[m]&&l==d[m]&&(a[m]==k||c[m]==k)&&(a[m]==k+1||c[m]==k+1)){
		o[k][l]=o[k][l]+100;
	      }
	      }
	  //cout<<k<<l<<"o"<<o[k][l]<<endl;
	      if(o[k][l]==0){u[k+1][l]=u[k+1][l]+u[k][l];
		u[k][l+1]=u[k][l+1]+u[k][l];
	      }else if(o[k][l]==1){u[k+1][l]=u[k+1][l]+u[k][l];
	      }else if(o[k][l]==100){u[k][l+1]=u[k][l+1]+u[k][l];
	      }
	      //cout<<k<<l<<"u"<<u[k][l]<<endl;
	  }
	}
      if(u[tate][yoko]==0){cout<<"Miserable Hokusai!"<<endl;
      }else{cout<<u[tate][yoko]<<endl;}
      for(int uma=0;uma<20;uma++){
	for(int yagi=0;yagi<20;yagi++){
      u[uma][yagi]=0;
      o[uma][yagi]=0;
	}
      }
      int tate=0;
      int yoko=0;
      int ushi=0;
      for(int neko=0;neko<101;neko++){
      a[neko]=0;
      b[neko]=0;
      c[neko]=0;
      d[neko]=0;
      }
      //cout<<tate<<yoko<<ushi<<endl;
    }
}