#include <cstdio>
#include <cstring>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define clr(a,v) memset((a),(v),sizeof(a))

int gx, gy;
int p;
int t;
bool mat[16][16][16][16];
int dp[16][16];

int main()
{
  scanf( "%d", &t );

  while( t-- )
  {
    clr( mat, false );
    clr( dp, 0 );
    scanf( "%d%d%d", &gx, &gy, &p );

    rep( i, p )
    {
      int x1, y1, x2, y2;
      scanf( "%d%d%d%d", &x1, &y1, &x2, &y2 );
      mat[y1][x1][y2][x2] = mat[y2][x2][y1][x1] = true;
    }

    dp[0][0] = 1;
    repi( i, 1, gy+1 )
    {
      if( mat[i-1][0][i][0] )
        break;

      dp[i][0] = 1;
    }
    repi( j, 1, gx+1 )
    {
      if( mat[0][j-1][0][j] )
        break;

      dp[0][j] = 1;
    }

    repi( i, 1, gy+1 ) repi( j, 1, gx+1 )
      dp[i][j] = (!mat[i-1][j][i][j] ? dp[i-1][j] : 0) + (!mat[i][j-1][i][j] ? dp[i][j-1] : 0);

    if( !dp[gy][gx] )
      puts( "Miserable Hokusai!" );
    else
      printf( "%d\n", dp[gy][gx] );
  }

  return 0;
}