The first line is an integer $t$, denoting the number of test cases follows.
For each test case, there are two polygons, the base polygon of $A$ and $B$ respectively.
An integer $n$ ($3 \le n \le 10^5$) followed by $n$ lines, each containing two space-separated integers $(x, y)$ ($-10^6 \le x, y \le 10^6$), is the representation of the base polygon of $A$. The following $m+1$ ($3 \le m \le 10^5$) gives a similar representation for $B$, except that the coordinates given are $(y, z)$ ($-10^6 \le x, y \le 10^6$).
Each polygon are given in either clockwise or counterclockwise order. Following the convention, polygon $P$ is simple, if no two edges have any points in common, with the obvious exception of two consecutive segments having one common point.
The sum of $m+n$ from all test cases does not exceed $2 \cdot 10^6$.