There are mutiple test cases.
Each case starts with a line containing two integers $n,m (1 \leq n,1 \leq m , n \times m \leq 10^7)$ which represent the area of the land.
And the secend line contain a integer $p(1 \leq p \leq 10^6)$ which represent the number of the monitor Xiaoteng has installed. This is followed by p lines each describing a rectangle. Each of these lines contains four intergers $x_1,y_1,x_2~and~y_2(1\leq x_1 \leq x_2 \leq n,1\leq y_1 \leq y_2 \leq m)$ ,meaning the lower left corner and upper right corner of the rectangle.
Next line contain a integer $q(1 \leq q\leq 10^6)$ which represent the number of times that thieves will steal the crops.This is followed by q lines each describing a rectangle. Each of these lines contains four intergers $x_1,y_1,x_2~and~y_2(1\leq x_1 \leq x_2 \leq n,1\leq y_1 \leq y_2 \leq m)$,meaning the lower left corner and upper right corner of the rectangle.