#include<iostream>

#if 0
08-182020の方のものを参照。
コメントアウトしている部分のように、座標をpairで扱おうとしてかなり複雑になってしまった。

#endif


using namespace std;

int a[10000];
int s;
int n;
int p;
int gx,gy;
int T[15+10][15+10];
int Verz[15+10][15+10], Horiz[15+10][15+10];
/*
pair<int, int> pd;
int matatabix[10000],matatabiy[10000];
pair<int, int> matatabi1[10000], matatabi2[10000];
int Verz[10000][10000], Horiz[10000][10000];
*/

int main(){
  cin >> n;
  while(n!=0){
    n = n - 1;
    for(int i = 0; i < 15+10; ++i){
      for(int j = 0; j < 15+10; ++j){
        T[i][j] = (i == 0 && j == 0);
        Verz[i][j] = (j != 0);
        Horiz[i][j] = (i != 0);
      }
    }
    cin >> gx >> gy;//秘密の場所の座標
    cin >> p;
    int x1,x2,y1,y2;
    for(int i = 0; i < p; ++i){
      cin >> x1 >> y1 >> x2 >> y2;
      if(x1 == x2){
        Verz[max(x1, x2)][max(y1,y2)] = false;
      }
      if(y1 == y2){
        Horiz[max(x1, x2)][max(y1, y2)] = false;
      }
    }
    for (int i = 0; i <= gx; ++i) {
      for (int j = 0; j <= gy; ++j) {
        if (!(i == 0 && j == 0)) {
          if(i < 0 || j < 0){
          T[i][j] = 0;
        }
        else if(i ==0 && j == 0){
          T[i][j] = 1;
        }
        else if(Verz[i][j] == false && Horiz[i][j] == false){
          T[i][j] = 0;
        }
        else if(Verz[i][j] == false && Horiz[i][j] == true){
          T[i][j] = T[i - 1][j];
        }
        else if(Horiz[i][j] == false && Verz[i][j] ==true){
          T[i][j] = T[i][j - 1];
        }
        else{
          T[i][j] =T[i - 1][j] +T[i][j - 1];
        }
          //T[i][j] = (Horiz[i][j] ? T[i-1][j] : 0) + (Verz[i][j] ? T[i][j-1] : 0);
        }
      }
    }
    if(T[gx][gy] != 0){
      cout << T[gx][gy] << endl;
    }else{
      cout << "Miserable Hokusai!" << endl;
    }
    //cout << (T[gx][gy] ? to_string(T[gx][gy]) : "Miserable Hokusai!") << endl;
    /*
    cin >> pd.first >> pd.second;
    cin >> p;
    for(int i = 0; i < p; ++i){
      cin >> matatabi1[i].first >> matatabi1[i].second >> matatabi2[i].first >> matatabi2[i].second;
    }
    for(int i = 0; i < pd.first; ++i){
      for(int j = 0; j < pd.second; ++j){
        Verz[i][j] = true;
        Horiz[i][j] = true;
      }
    }
    for(int i = 0; i < pd.first; ++i){
      for(int j = 0; j < pd.second; ++j){
        if(matatabi1[j].second == matatabi2[j].second){
          Horiz[matatabi1[i].first ][max(matatabi1[j].second, matatabi2[j].second) ] = false;
        }
        if(matatabi1[i].first == matatabi2[i].first){
          Verz[max(matatabi1[i].first , matatabi2[i].first)][matatabi2[j].second] = false; 
        }
      }
    }
    for(int i = 0; i < pd.first; ++i){
      for(int j = 0; j < pd.second; ++j){
        T[0][0] = 1;
        if(i < 0 || j < 0){
          T[i][j] = 0;
        }
        else if(i ==0 && j == 0){
          T[i][j] = 1;
        }
        else if(Verz[i][j] == false && Horiz[i][j] == false){
          T[i][j] = 0;
        }
        else if(Verz[i][j] == false && Horiz[i][j] == true){
          T[i][j] = T[i - 1][j];
        }
        else if(Horiz[i][j] == false && Verz[i][j] ==true){
          T[i][j] = T[i][j - 1];
        }
        else{
          T[i][j] =T[i - 1][j] +T[i][j - 1];
        }
      }
    }
    if(T[pd.first][pd.second] != 0){
      cout << T[pd.first][pd.second] << endl;
    }
    else{
      cout << "Miserable Hokusai!" << endl;
      
    }
    */
  }
}


Measured memory_bytes: 3092