Almost Clear

No attempts yetTime limit1sMemory limit128 MB

Problem

A museum displays many valuable objects and installs surveillance cameras so that every object can be watched. Your task is to check a single camera against a single obstacle.

In the 2-D plane you are given a convex polygon AA (the valuable object), a convex polygon BB (another object), and a point CC (the camera). Determine how much of polygon AA is hidden by polygon BB when the camera is placed at CC.

Assumptions:

  1. All coordinates lie in the 2-D plane.
  2. Polygons AA and BB are both convex.
  3. The camera has infinite range (it can see arbitrarily far).
  4. The camera can rotate freely through a full 360°.
  5. The camera cannot move away from point CC.
  6. Every position is valid: the two polygons do not intersect, and the camera is never inside either polygon.

A point pp of polygon AA is hidden when the straight segment from CC to pp passes through polygon BB. Depending on how much of AA is hidden, decide whether AA is fully visible, partially hidden, or completely hidden.

Input

The first line contains an integer TT (1T10001 \le T \le 1000), the number of test cases.

Each test case consists of three lines:

  • The first line describes polygon AA: an integer M1M_1 (1M110001 \le M_1 \le 1000), the number of vertices, followed by M1M_1 coordinate pairs x yx\ y listing the vertices in counter-clockwise order.
  • The second line describes polygon BB in exactly the same format.
  • The third line contains two integers: the xx- and yy-coordinates of the camera CC.

All coordinates are non-negative and smaller than 2312^{31}.

Output

For each test case, print exactly one line:

  • CLEAR if polygon AA is not obstructed by polygon BB at all;
  • ALMOST CLEAR if polygon AA is only partially obstructed by polygon BB;
  • NO VISION if polygon AA is completely hidden by polygon BB.