#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())

typedef long long ll;

const int MAX = 128;

bool go[2][MAX][MAX];
ll dp[MAX][MAX];

void solve(void){
    int N;
    cin >> N;
    rep(N, meaningless_) {
        int gx, gy, p;
        cin >> gx >> gy >> p;
        memset(go, true, sizeof(go));
        memset(dp, 0LL, sizeof(dp));
        rep(p, i) {
            int lx, ly, rx, ry;
            cin >> lx >> ly >> rx >> ry;
            if (lx == rx) {
                go[0][rx][min(ly, ry)] = false;
            }
            else {
                go[1][min(rx, lx)][ly] = false;
            }
        }
        dp[0][0] = 1LL;
        rep(gx+1, x) rep(gy+1, y) {
            if (go[1][x][y]) dp[x+1][y] += dp[x][y];
            if (go[0][x][y]) dp[x][y+1] += dp[x][y];
        }
        /*
        rep(gy+1, y) {
            rep(gx+1, x) {
                cout << dp[x][y] << ' ';
            }
            cout << endl;
        }*/
        if (dp[gx][gy]) cout << dp[gx][gy] << endl;
        else cout << "Miserable Hokusai!" << endl;
    }
}

int main(void){
  solve();
  //cout << "yui(*-v・)yui" << endl;
  return 0;
}

