#include <stdio.h>
#include <iostream>
#include <queue>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include<cstdio>
#include<cstring>
#include<time.h>
#include<iomanip>
#define PB push_back
#define in scanf
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define IREP(i,n) for (int i=0;i<=(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using	namespace std;
int n,k;
int main(){
    cin >> n;
    REP(kk,n){pair<int ,int > g ;
    cin >> g.first >> g.second ;
    cin >> k;
    int x1,x2,y1,y2;
    bool map[16][16][16][16];//[x1][y1]???[x2][y2]
    memset (map,-1,sizeof(map));
    REP(i,k){
      cin >> x1 >> y1 >> x2 >> y2;
      map[x1][y1][x2][y2] = false;
      map[x2][y2][x1][y1] = false;
    }
    int dp[17][17];
    memset (dp,0,sizeof(dp));
    dp[0][0]=0 ;
    dp[1][1]=1 ;
    REP(y,g.second+1){
      REP(x,g.first+1){
        if(x==0 && y==0)continue;

        if(x > 0&& map[x-1][y][x][y]){
          dp[y+1][x+1] += dp[y+1][x];
          }
        if(y > 0&& map[x][y-1][x][y]){
          dp[y+1][x+1] += dp[y][x+1];
        }

      }
    }
    if(dp[g.second+1][g.first+1]==0)printf("Miserable Hokusai!\n");
    else printf("%d\n",dp[g.second+1][g.first+1]);

}
}