Broken Nail
A decorative frame is hanging on a vertical wall, secured by two nails.
The frame is a polygon of an arbitrary shape, which includes cutouts, each also being a polygon of arbitrary shape.
If one of the nails breaks, the frame will start to swing around the remaining nail due to gravity. After several oscillations, the frame will settle into a new stable position (refer to the figure).
Your task is to calculate the absolute magnitude of the angle by which the frame rotates from its initial position once it stabilizes.
Notes:
The frame will begin to oscillate if the x-axis distance between the remaining nail and the frame's center of gravity is greater than 10^{-6}.
Assume the nail has zero diameter, meaning the nail hole is not considered when calculating the frame's center of gravity.
Ignore any friction between the frame and the nail.
The polygons forming the frame and cutouts do not have intersecting or touching sides.
The sides of the frame and cutouts do not touch or intersect each other.
The cutouts do not overlap.
The nail is located inside the frame, not in any cutout, and is not on the edges of the frame or cutouts.
No three consecutive vertices of the frame or cutout are collinear.
Input
The first line contains a single integer N – the number of vertices of the frame (3 ≤ N ≤ 50).
The next N lines provide the coordinates of the i-th vertex of the frame as two integers PiX and PiY, separated by a space (1 ≤ i ≤ N, 0 ≤ PiX ≤ 100, 0 ≤ PiY ≤ 100). The vertices are listed in the order they connect to form the polygon.
The following line contains a single integer L – the number of cutouts (0 ≤ L ≤ 10).
Each of the next L blocks describes a cutout.
The first line of the j-th block (1 ≤ j ≤ L) contains a single integer Mj – the number of vertices of the j-th cutout (3 ≤ Mj ≤ 50).
The next Mj lines of the j-th block provide the coordinates of the k-th vertex of the cutout as two integers VkX and VkY, separated by a space (1 ≤ k ≤ Mj, 1 ≤ VkX ≤ 99, 1 ≤ VkY ≤ 99). The vertices are listed in the order they connect to form the polygon.
The last line contains two integers ZX and ZY, separated by a space – the coordinates of the remaining nail (1 ≤ ZX ≤ 99, 1 ≤ ZY ≤ 99).
Output
The output should be a single real number A – the absolute magnitude of the frame's rotation angle (0 ≤ A < 180). The result should be formatted to six decimal places, using a dot as the decimal separator.