#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 40;

int K;

int main(){
	cin >> K;
	for (int t = 0; t < K; t++){
		int T[MAX][MAX] = { 0 }, x, y, p, x1, x2, y1, y2,
			L[MAX][MAX] = { 0 }, up[MAX][MAX] = { 0 };
		
		cin >> x >> y;
		cin >> p;
		for (int i = 0; i < p; i++){
			cin >> x1 >> y1 >> x2 >> y2;
			if (x1 == x2)up[x1+1][max(y1, y2)+1]=1;
			else L[max(x1, x2) + 1][y1 + 1] = 1;
		}
		for (int i = 1; i <= x+1; i++){
			for (int j = 1; j <= y+1; j++){
				if (i == 1 && j == 1)T[i][j] = 1;
				if (L[i][j] == 0)T[i][j] += T[i - 1][j];
				if (up[i][j] == 0)T[i][j] += T[i][j - 1];
			}
		}
		if (!T[x + 1][y + 1])cout << "Miserable Hokusai!" << endl;
		else cout << T[x + 1][y + 1] << endl;

	}
}