#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main()
{   
    int n;
    cin >> n;

    REP(r, n) {
        int gx, gy;
        cin >> gx >> gy;

        /* dpテーブル生成 */
        vector<vector<int>> dp(gy+2, vector<int> (gx+2, 0));
        dp[0][1] = 1;

        /* 通り抜けることができるかどうかの判定要素 */
        vector<vector<bool>> vert(gy+2, vector<bool> (gx+2, false));
        vector<vector<bool>> hori(gy+2, vector<bool> (gx+2, false));

        int p;
        int x0, y0, x1, y1;
        cin >> p;

        REP(i, p) {
            cin >> x0 >> y0 >> x1>> y1;
            if (x0 == x1)   vert[max(y0, y1)+1][x0+1] = true;
            else            hori[y0+1][max(x0, x1)+1] = true;
            
        }

        for (int i = 1; i < gy+2; i++) {
            for (int j = 1; j < gx+2; j++) {

                if (vert[i][j] && hori[i][j])     dp[i][j] = 0;
                else if (vert[i][j])              dp[i][j] = dp[i][j-1];
                else if (hori[i][j])              dp[i][j] = dp[i-1][j];
                else    dp[i][j] = dp[i-1][j] + dp[i][j-1];
            }
        }

        if (dp[gy+1][gx+1] == 0)    cout << "Miserable Hokusai!" << endl;
        else cout << dp[gy+1][gx+1] << endl;
        
        /*
        REP(i, gy+2) {
            REP(j, gx+2) {
                cout << dp[i][j] << " ";
            }
            cout << endl;
        }
        */
    }
}
