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

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y, p;
    cin >> x >> y;
    bool ver[x + 1][y + 1];
    bool hol[x + 1][y + 1];
    for (int i = 0; i <= x; i++) {
      for (int l = 0; l <= y; l++) {
        ver[i][l] = true;
        hol[i][l] = true;
        if (i == 0) {
          hol[i][l] = false;
        }
        if (l == 0) {
          ver[i][l] = false;
        }
      }
    }
    cin >> p;
    for (int i = 0; i < p && p; i++) {
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1 == x2) {
        ver[x1][max(y1, y2)] = false;
      }
      if (y1 == y2) {
        hol[max(x1, x2)][y1] = false;
      }
    }
    int T[x + 1][y + 1];
    T[0][0] = 1;
    for (int i = 0; i <= x; i++) {
      for (int l = 0; l <= y; l++) {
        if (l != 0 || i != 0) T[i][l] = 0;
        if (ver[i][l] == true)
        {
          T[i][l] += T[i][l - 1];
        }
        if (hol[i][l] == true) {
          T[i][l] += T[i - 1][l];
        }
      }
    }
    if (T[x][y] == 0) {
      cout << "Miserable Hokusai!" << endl;
    } else {
      cout << T[x][y] << endl;
    }
  }
}
