The first line contains an integer $T(T \le 10)$ —the number of test cases.
The first line of each test case contains 3 integers $n,m,K(1 \le n,m,K \le 15)$ —length and width of rectangular area, number of walls
The second line of each test case contains 4 integers $x_s,y_s,x_t,y_t(0 \le x_s,x_t < n,0 \le y_s,y_t < m)$ — the position of the hero and the dragon.
The next $K$ lines , each line contains 4 integers $x_1,y_1,x_2,y_2(0 \le x_1,x_2 \le n,0 \le y_1,y_2 \le m)$ — indicates the location of the two endpoints of the wall, ensuring that $x_1=x_2$ or $y_1=y_2$.