//Heian-Kyo Walking
//????????????????´?2??????
//??????????????????????????¨??????????????§?????£???????§????????????§???????????¨?????¨????????????????????????????????£??????
//left[i][j]???????????¨????????????(i,j)????§???????????????¨?????§???????????¨???????????¨?????¨???????????????up[i][j]???????§????


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

int main() {
	int counter;
	cin >> counter;
	for (int n = 0; n < counter; n++) {
		int gx, gy, p;
		cin >> gx >> gy;
		cin >> p;
		int x1, x2, y1, y2, t[16][16] = {}, up[16][16] = {} ,left[16][16] = {};
		for (int m = 1; m <= p; m++){
			cin >> x1 >> y1 >> x2 >> y2;
			if (x1 == x2)
				up[x1][max(y1, y2)] = 1;
			if (y1 == y2)
				left[max(x1, x2)][y1] = 1;
		}
		for (int j = 0; j <= 15; j++)
			left[0][j] = 1;
		for (int i = 0; i <= 15; i++)
			up[i][0] = 1;
		t[0][0] = 1;
		for (int j = 0; j <= gy; j++) {
			for (int i = 0; i <= gx; i++) {
				if (left[i][j] == 0 && i >= 0) 
					t[i][j] += t[i-1][j];
				if (up[i][j] == 0 && j >= 0) 
					t[i][j] += t[i][j-1];
			}
		}
		if (t[gx][gy] == 0)
			cout << "Miserable Hokusai!" << endl;
		else
			cout << t[gx][gy] << endl;
	}
}