#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	int map[20][20];
	int a[20][20];
	cin >> n;
	for (int z = 0; z < n; z++) {
		for (int i = 0; i < 20; i++) { for (int j = 0; j < 20; j++) { map[i][j] = 0; a[i][j] = 0; } }
		int s, t;
		cin >> s >> t;
		map[s][t] = 100;
		int p;
		cin >> p;
		int x, y, xx, yy;
		for (int i = 0; i < p; i++) {
			scanf("%d%d%d%d", &x, &y, &xx, &yy);
			if (x == xx) { map[x][min(y, yy)] += 1; }
			if (y == yy)map[min(x, xx)][y] += 2;
		}
		a[0][0] = 1;
		for (int i = 0; i <= s; i++) {
			for (int j = 0; j <= t; j++)
			{
				if (i > 0) { if (!(map[i - 1][j] >= 2))a[i][j] += a[i - 1][j]; }
				if (j > 0) { if (!(map[i][j - 1] == 1 || map[i][j - 1] == 3))a[i][j] += a[i][j - 1]; }
			}
		}
		if (a[s][t] == 0)cout << "Miserable Hokusai!" << endl;
		else cout << a[s][t] << endl;
	}
}