#include <stdio.h>
#include <string.h>

int main(void)
{
    int route[17][17];
    int matatabi[16][16][16][16];
    int gx, gy;
    int p;
    int n;
    int i, j;
    int x1, y1, x2, y2;
    int x, y;
    int m;
    
    scanf("%d", &n);
    for (i = 0; i < n; i++){
        memset(route, 0, sizeof(route));
        memset(matatabi, 0, sizeof(matatabi));

        scanf("%d%d", &gx, &gy);
        
        scanf("%d", &p);
        for (j = 0; j < p; j++){
            scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
            matatabi[x1][y1][x2][y2] = matatabi[x2][y2][x1][y1] = 1;
        }
        
        route[0 + 1][0 + 1] = 1;
        for (y = 0; y <= gy; y++){
            for (x = 0; x <= gx; x++){
                if (x == 0 && y == 0){
//printf("<%d>", route[1][1]);
                    continue;
                }
                
                m = 0;
                if (matatabi[x][y][x - 1][y] == 0){
                    m += route[x - 1 + 1][y + 1];
                }
                if (matatabi[x][y][x][y - 1] == 0){
                    m += route[x + 1][y - 1 + 1];
                }
                route[x + 1][y + 1] = m;
//printf("<%d>", m);
            }
//printf("\n");
        }
        
        if (route[gx + 1][gy + 1] == 0){
            printf("Miserable Hokusai!\n");
        }
        else {
            printf("%d\n", route[gx + 1][gy + 1]);
        }
    }
    return (0);
}