#include<iostream>
#include<cstdio>
#include<vector>
#include<cstring>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)

bool ng[16][16][16][16];
long long dp[16][16];

void solve() {
  int X, Y; cin >> X >> Y;
  memset(ng, 0, sizeof(ng));
  memset(dp, 0, sizeof(dp));
  int P; cin >> P;
  REP(p, P) {
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      ng[x1][y1][x2][y2] = true;
      ng[x2][y2][x1][y1] = true;
  }
  dp[0][0] = 1;
  for (int x = 0; x <= X; x++)
      for (int y = 0; y <= Y; y++) {
          if (x - 1 >= 0 && !ng[x][y][x - 1][y])
              dp[x][y] += dp[x - 1][y];
          if (y - 1 >= 0 && !ng[x][y][x][y - 1])
              dp[x][y] += dp[x][y - 1];
      }

  if (dp[X][Y] == 0)
      cout << "Miserable Hokusai!" << endl;
  else
      cout << dp[X][Y] << endl;
}

int main() {
  int T; cin >> T;
  for (;T--;) solve();
  return 0;
}