The first line of the input consists of a single integer $D (1 ≤ D ≤ 5)$, denoting the number of silicon plates. $D$ blocks follow, each describing one silicon plate. The first line of each block contains three integers $N (1 ≤ N ≤ 150), M (1 ≤ M ≤ 10), K (0 ≤ K ≤ MN)$ separated by single spaces. $N$ is the length of the plate, $M$ is its height and $K$ is the number of bad squares in the plate. The following $K$ lines contain a listof bad squares. Each line consists of two integers $x$ and $y (1 ≤ x ≤ N, 1 ≤ y ≤ M)$ – coordinates of one bad square (the upper left square has coordinates $[1,1]$, the bottom right is $[N,M]$).

