#include <iostream>
using namespace std;
int T, p; // number of test cases, number of matatabi
int Gx, Gy; // goal coordinates
int A[100][100]; // Goal matrix value
bool Horiz[100][100]; // Horizontal movement
bool Vert[100][100]; // Vertical movement

struct matatabi {
  int x1;
  int y1;
  int x2;
  int y2;
};
int main() {
  cin >> T;
  for (int t=0; t<T; ++t) {
    int x1, y1, x2, y2;
    cin >> Gx >> Gy;
    cin >> p;
    for (int a=0; a<Gx+1; ++a) {
      for (int b=0; b<Gy+1; ++b) {
	Horiz[a][b] = true;
	Vert[a][b] = true;
      }
    } // Initialize matatabi coordinates as true

    for (int i=0; i<p; ++i) {
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1 == x2) Vert[x2][max(y1,y2)] = false;
      else if (y1 == y2) Horiz[max(x1,x2)][y2] = false;
    } // Mark where the matatabi are

    for (int i=0; i<Gx+1; ++i) {
      for (int j=0; j<Gy+1; ++j) {
	Vert[i][0] = false;
	Horiz[0][j] = false;
	if (i == 0 && j == 0)
	  {
	    A[i][j] = 1;
	  }
	else if (!Horiz[i][j] && !Vert[i][j])
	  {
	  A[i][j] = 0;
	  }
	else if (Horiz[i][j] && !Vert[i][j])
	  {
	  A[i][j] = A[i-1][j];
	  }
	else if (!Horiz[i][j] && Vert[i][j])
	  {
	  A[i][j] = A[i][j-1];
	  }
	else if (Horiz[i][j] && Vert[i][j])
	  {
	  A[i][j] = A[i-1][j] + A[i][j-1];
	  }
      }
    }
    if (A[Gx][Gy] == 0) cout << "Miserable Hokusai!" << endl;
    else cout << A[Gx][Gy] << endl;
  }
}