#include <bits/stdc++.h>
using namespace std;

int mata[17][17][17][17];

int main() {

  int data;
  cin >> data ;
  for(int i=0;i<data;i++) {
    //0で初期化
    memset(mata,0,sizeof(mata));

    int gx,gy;
    cin >> gx >> gy;
    gx++;
    gy++;

    int map[17][17];

    memset(map,0,sizeof(map));

    int n,a[2],b[2];


    cin >> n;


    for(int i=0;i<n;i++) {
      cin >> a[0] >> b[0] >> a[1] >> b[1];
      a[0]++;
      a[1]++;
      b[0]++;
      b[1]++;
      mata[a[0]][b[0]][a[1]][b[1]] = 1;
      mata[a[1]][b[1]][a[0]][b[0]] = 1;
    }

    map[1][1] = 1;

    for(int j=1;j<=gy;j++) {
      for(int i=1;i<=gx;i++) {

       
	if(mata[i-1][j][i][j] != 1) map[i][j] += map[i-1][j];

	if(mata[i][j-1][i][j] !=1) map[i][j] += map[i][j-1];
	  

      }
    }

    if(map[gx][gy] == 0) cout << "Miserable Hokusai!" << endl;
    else 
    cout << map[gx][gy] << endl;

  }

  return 0;

  
}