#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
using namespace std;

int main(){
  int t;
  scanf("%d", &t);
  while(t--){
    int gx, gy, p, f[16][16] = {}, b[16][16] = {}, x1, y1, x2, y2;
    scanf("%d%d%d", &gx, &gy, &p);
    rep(i, p){
      scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
      b[max(y1, y2)][max(x1, x2)] += (x1 == x2)?1:2;
    }
    f[0][0] = 1;
    REP(i, 1, gx+1)  f[0][i] = (b[0][i]==0?f[0][i-1]:0);
    REP(i, 1, gy+1)  f[i][0] = (b[i][0]==0?f[i-1][0]:0);

    REP(i, 1, gy+1) REP(j, 1, gx+1){
      if(b[i][j] == 0) f[i][j] = f[i-1][j] + f[i][j-1];
      else if(b[i][j] == 1) f[i][j] = f[i][j-1];
      else if(b[i][j] == 2) f[i][j] = f[i-1][j];
      else if(b[i][j] == 3) f[i][j] = 0;
    }
    if(f[gy][gx]) printf("%d\n", f[gy][gx]); else puts("Miserable Hokusai!");
  }
  return 0;
}