trial = int(input())

for t in range(trial):
    targ = [int(n) for n in f.readline().split(' ')]
    root = [[0 for n in range(targ[0] + 1)] for m in range(targ[1] + 1)]
    matanum = int(f.readline())
    for m in range(matanum):
        matax,matay,secx,secy = (int(n) for n in f.readline().split(' '))
        if matax == secx:
            root[max(matay,secy)][matax] = 'y'
        else:
            root[matay][max(secx,matax)] = 'x'
    for yaxis in range(targ[1] + 1):
        for xaxis in range(targ[0] + 1):
            if xaxis == 0:
                if root[yaxis][xaxis] == 'y':
                    root[yaxis][xaxis] = 0
                else:
                    if yaxis == 0:
                        root[0][0] = 1
                    else:
                        root[yaxis][xaxis] = root[yaxis- 1][xaxis]
            elif yaxis == 0:
                if root[yaxis][xaxis] == 'x':
                    root[yaxis][xaxis] = 0
                else:
                    root[yaxis][xaxis] = root[yaxis][xaxis-1]
            else:
                if root[yaxis][xaxis] == 'y':
                    root[yaxis][xaxis] = root[yaxis][xaxis - 1]
                elif root[yaxis][xaxis] == 'x':
                    root[yaxis][xaxis] = root[yaxis - 1][xaxis]
                else:
                    root[yaxis][xaxis] = root[yaxis - 1][xaxis] + root[yaxis][xaxis - 1]
    if root[targ[1]][targ[0]] == 0:
        print("Miserable Hokusai!")
    else:
        print(root[targ[1]][targ[0]])

### FIXED CODE ###

trial = int(input())

for t in range(trial):
    targ = [int(n) for n in input().split(' ')]
    root = [[0 for n in range(targ[0] + 1)] for m in range(targ[1] + 1)]
    matanum = int(input())
    for m in range(matanum):
        matax,matay,secx,secy = (int(n) for n in input().split(' '))
        if matax == secx:
            if root[max(matay,secy)][matax] == 'x':
                root[max(matay,secy)][matax] = 'xy'
            else:
                root[max(matay,secy)][matax] = 'y'
        else:
            if root[matay][max(matax,secx)] == 'y':
                root[matay][max(matax,secx)] = 'xy'
            else:
                root[matay][max(matax,secx)] = 'x'
    for yaxis in range(targ[1] + 1):
        for xaxis in range(targ[0] + 1):
            if xaxis == 0:
                if root[yaxis][xaxis] == 'y' or root[yaxis][xaxis] == 'xy':
                    root[yaxis][xaxis] = 0
                else:
                    if yaxis == 0:
                        root[0][0] = 1
                    else:
                        root[yaxis][xaxis] = root[yaxis- 1][xaxis]
            elif yaxis == 0:
                if root[yaxis][xaxis] == 'x' or root[yaxis][xaxis] == 'xy':
                    root[yaxis][xaxis] = 0
                else:
                    root[yaxis][xaxis] = root[yaxis][xaxis-1]
            else:
                if root[yaxis][xaxis] == 'xy':
                    root[yaxis][xaxis] = 0
                elif root[yaxis][xaxis] == 'y':
                    root[yaxis][xaxis] = root[yaxis][xaxis - 1]
                elif root[yaxis][xaxis] == 'x':
                    root[yaxis][xaxis] = root[yaxis - 1][xaxis]
                else:
                    root[yaxis][xaxis] = root[yaxis - 1][xaxis] + root[yaxis][xaxis - 1]
    if root[targ[1]][targ[0]] == 0:
        print("Miserable Hokusai!")
    else:
        print(root[targ[1]][targ[0]])