#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

void solve() {
	int gx, gy;
	cin >> gx >> gy;

	const int w = gx + 1, h = gy + 1;
	vector<vector<bool>> can_move_right(h, vector<bool>(w, true));
	auto can_move_down(can_move_right);

	for(int y = 0; y <= gy; ++y) can_move_right[y][gx] = false;
	for(int x = 0; x <= gx; ++x) can_move_down[gy][x]  = false;

	int p;
	cin >> p;

	while(p--) {
		int x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		auto &tmp = (x1 != x2 ? can_move_right : can_move_down);
		tmp[min(y1, y2)][min(x1, x2)] = false;
	}

	vector<vector<int>> dp(h, vector<int>(w, 0));
	dp[0][0] = 1;

	for(int y = 0; y <= gy; ++y) {
		for(int x = 0; x <= gx; ++x) {
			if(can_move_right[y][x]) dp[y][x + 1] += dp[y][x];
			if(can_move_down[y][x])  dp[y + 1][x] += dp[y][x];
		}
	}

	if(dp[gy][gx]) {
		cout << dp[gy][gx] << endl;
	}
	else {
		cout << "Miserable Hokusai!" << endl;
	}
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int T;
	cin >> T;

	while(T--) {
		solve();
	}

	return EXIT_SUCCESS;
}