#include <iostream>

int main()
{
    int number_dataset;
    std::cin >> number_dataset;//?????????????????°???????????????
    
    for (int dataset = 1 ; dataset <= number_dataset ; dataset++) {//?????????????????°???????????????????????????
    
        const int height = 16, width = 16;
    
        int pattern[height][width];//i,j?????????????????????????????°????????????????????????
        int can_walk[height][width];//i,j???????????????????????????????????\????????????????????????????????????????????°??§??¨????????¨??????10?????????1?????¨???????????\????????????1?????????1?????¨???????????\????????????
        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                pattern[i][j] = 0;//?????????
                can_walk[i][j] = 3;//????????????????????§????????????
            }
        }
        pattern[0][0]=1;//????????????????????????


        //???????????????????????£?????????
        int dest_x, dest_y;//????¨???°???????????????????????°????????????
        std::cin >> dest_x >> dest_y;//??£??\?????????
        
        int number_obstacle;//??????????????°????????????????????°?????????
        std::cin >> number_obstacle;//??£??\??????
        
        for (int obstacle = 0; obstacle < number_obstacle; obstacle++) {//?????????????????°???????????????????????????
            int place[2][2];//?????????????????????????????????????????????????????°
            std::cin >> place[0][0] >> place[0][1] >> place[1][0] >> place[1][1];
            
            if(place[0][0] < place[1][0]){ //???????????????????????????????????¨???
                can_walk[place[1][0]][place[1][1]] &= 2;//1?????????????????????
            } else if(place[0][0] > place[1][0]){ //??????????????¨???
                can_walk[place[0][0]][place[0][1]] &= 2;//1?????????????????????
            } else if(place[0][1] > place[1][1]){ //??????????????¨???
                can_walk[place[0][0]][place[0][1]] &= 1;//10?????????????????????
            } else {//??????????????¨???
                can_walk[place[1][0]][place[1][1]] &= 1;//10?????????????????????
            }
        }
    
    
    
        for (int tate = 0; tate <= dest_x; tate++) {//??¢?´¢?????????????¨???°??????x,y?????§???????????°?????????
            for (int yoko = 0; yoko <= dest_y; yoko++) {
                if(tate != 0 && can_walk[tate][yoko] % 2 == 1) {//????????§??????????????????????????\???????????¨???
                    pattern[tate][yoko] +=pattern[tate-1][yoko];//???????????\?????¨??????????????????????¶???????
                }
                if (yoko != 0 && can_walk[tate][yoko] / 2 == 1) {//????????§??????????????????????????\???????????¨??????
                    pattern[tate][yoko] += pattern[tate][yoko-1];//???????????\?????¨??????????????????????¶???????
                }
            }
        }
    
        /*
        for (int i = 0; i < height; i++) {//??????(???????????°??¨)
            for (int j = 0; j < width; j++) {
                std::cout << pattern[i][j] << " ";
            }
            std::cout << std::endl;
        }
        std::cout << pattern[dest_x][dest_y] << std::endl;
        std::cout << "---------------------"<<std::endl;//for debug
        */
        
        
        if(pattern[dest_x][dest_y] == 0) {//????????£??????
            std::cout << "Miserable Hokusai!" << std::endl;
        } else {
            std::cout << pattern[dest_x][dest_y] << std::endl;
        }
    
    }
    return 0;
}

Measured memory_bytes: 1160