#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> answer;
    for (int i = 0; i < n; i++)
    {
        int gx, gy, m;
        cin >> gx >> gy >> m;
        gx++;
        gy++;
        int matatabi[4];
        int route[gx][gy];
        bool vertical[gx][gy];
        bool horizontal[gx][gy];
        for (int j = 0; j < gx; j++)
        {
            for (int k = 0; k < gy; k++)
            {
                if (k == 0)
                {
                    vertical[j][k] = 0;
                }
                else
                {
                    vertical[j][k] = 1;
                }
                if (j == 0)
                {
                    horizontal[j][k] = 0;
                }
                else
                {
                    horizontal[j][k] = 1;
                }
            }
        }
        for (int j = 0; j < m; j++)
        {
            cin >> matatabi[0] >> matatabi[1] >> matatabi[2] >> matatabi[3];
            if (matatabi[0] > matatabi[2])
            {
                horizontal[matatabi[0]][matatabi[1]] = 0;
            }
            else if (matatabi[0] < matatabi[2])
            {
                horizontal[matatabi[2]][matatabi[1]] = 0;
            }
            else if (matatabi[1] < matatabi[3])
            {
                vertical[matatabi[0]][matatabi[3]] = 0;
            }
            else if (matatabi[1] > matatabi[3])
            {
                vertical[matatabi[0]][matatabi[1]] = 0;
            }
        }
        route[0][0] = 1;
        for (int j = 0; j < gx + gy - 1; j++)
        {
            for (int k = 0; k < j + 1; k++)
            {
                if (k < gx && j - k < gy)
                {
                    if (horizontal[k][j - k])
                    {
                        if (vertical[k][j - k])
                        {
                            route[k][j - k] = route[k - 1][j - k] + route[k][j - k - 1];
                        }
                        else
                        {
                            route[k][j - k] = route[k - 1][j - k];
                        }
                    }
                    else
                    {
                        if (vertical[k][j - k])
                        {
                            route[k][j - k] = route[k][j - k - 1];
                        }
                        else if (j == 0)
                        {
                            route[0][0] = 1;
                        }
                        else
                        {
                            route[k][j - k] = 0;
                        }
                    }
                }
            }
        }
        /*
        for (int j = 0; j < gx; j++)
        {
            for (int k = 0; k < gy; k++)
            {
                cout << route[j][k] << " ";
            }
            cout << endl;
        }
        */
        answer.push_back(route[gx - 1][gy - 1]);
    }
    for (int i = 0; i < n; i++)
    {
        if (answer.at(i) == 0)
        {
            cout << "Miserable Hokusai!" << endl;
        }
        else
        {
            cout << answer.at(i) << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3052