#include <iostream>
#include <algorithm>

using namespace std;

const int N = 16;

bool edge[N][N][N][N];
int dp[N][N];
int w, h;

int main(){
  int n;
  cin >> n;
  while(n--){
    fill(edge[0][0][0], edge[N][0][0], true);
    cin >> w >> h;
    int p;
    cin >> p;
    for(int i=0;i<p;i++){
      int a, b, c, d;
      cin >> b >> a >> d >> c;
      edge[a][b][c][d] = edge[c][d][a][b] = false;
    }
    fill(dp[0], dp[N], 0);
    for(int i=0;i<=h;i++){
      for(int j=0;j<=w;j++){
        if(i == 0 && j == 0){
          dp[0][0] = 1;
          continue;
        }else if(i == 0){
          if(edge[i][j][i][j-1]) dp[i][j] += dp[i][j-1];
        }else if(j == 0){
          if(edge[i][j][i-1][j]) dp[i][j] += dp[i-1][j];
        }else{
          if(edge[i][j][i-1][j]) dp[i][j] += dp[i-1][j];
          if(edge[i][j][i][j-1]) dp[i][j] += dp[i][j-1];
        }
      }
    }
    if(dp[h][w]) cout << dp[h][w] << endl;
    else cout << "Miserable Hokusai!" << endl;
  }
  return 0;
}