#include<iostream>
#include<algorithm>
using namespace std;

int dp[10000][10000];
int hole[10000][10000]; // (from) 0:none, 1: x, 2 : y, 3 : x, y
int calced[10000][10000];

int solve(int x, int y){
	if (x < 0 || y < 0)return 0;
	if (x == 0 && y == 0)return 1;
	if (calced[x][y] == 1)return dp[x][y];

	switch (hole[x][y]) {
	case 0:
		calced[x][y] = 1;
		return dp[x][y] = solve(x - 1, y) + solve(x, y - 1);
		break;
	case 1:
		calced[x][y] = 1;
		return dp[x][y] = solve(x, y - 1);
		break;
	case 2:
		calced[x][y] = 1;
		return dp[x][y] = solve(x - 1, y);
		break;
	case 3:
		calced[x][y] = 1;
		return dp[x][y] = 0;
		break;
	}
}


int main() {
	int i, j, k, n, p, gx, gy, x1, x2, y1, y2, ans;

	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> gx >> gy;
		for (j = 0; j <= gx; j++) {
			for (k = 0; k <= gy; k++) {
				dp[j][k] = 0;
				hole[j][k] = 0;
				calced[j][k] = 0;
			}
		}
		cin >> p;
		for (j = 0; j < p; j++) {
			cin >> x1 >> y1 >> x2 >> y2;
			if (x1 > x2) {
				swap(x1, x2);
				swap(y1, y2);
			} else if (y1 > y2) {
				swap(x1, x2);
				swap(y1, y2);
			}
			if (x2 != x1) {
				hole[x2][y2] += 1;
			} else {
				hole[x2][y2] += 2;
			}
		}
	
		ans = solve(gx, gy);

		if (ans == 0) {
			cout << "Miserable Hokusai!" << endl;
		} else {
			cout << ans << endl;
		}
		
		


	}




	return 0;
}