Mission Impossible

No attempts yetTime limit3sMemory limit128 MB

Problem

You have been hired to explore enemy territory, a risky business. The enemy has placed several radar stations across the country; each radar instantly destroys any moving vehicle within its circular range of coverage.

Fortunately, your government has given you a map of the enemy territory: the coordinates and coverage radius of every radar. You also have a list of local informers and their locations. Your mission is to contact one informer, preferably the one with the highest insider-coefficient.

The insider-coefficient of an informer is the distance from that informer to the border of the country, that is, the minimum distance from the informer's location to any point on the border. Intuitively, the informer with the highest insider-coefficient is located as deep inside the country as possible, and is presumed to hold the most valuable information.

Write a program that decides whether there is a path from your starting location, always the point $(2000, 2000)$, to some informer's location, without ever entering a region covered by a radar. Whenever such a path exists, the program must also report which reachable informer should be contacted, according to the insider-coefficient criterion above.

Figure 1: A possible scenario

The enemy country has the shape of a simple polygon (not necessarily convex); a polygon is simple when its boundary is a single, non-self-intersecting loop. The border is given as the sequence of vertices of the polygon. Every radar centre and every informer lies inside the border, but a radar's coverage may extend outside the border.

In Figure 1, informer $I_1$ cannot be contacted because he lies inside a radar-covered region. Informer $I_2$, although outside every radar region, cannot be contacted either, because any route to him would pass through a deadly radar-covered region. Both $I_3$ and $I_4$ can be contacted, so $I_4$ is chosen because his insider-coefficient is greater than that of $I_3$.

Input

The input consists of several test cases. The first line of each test case describes the border of the enemy country:

B X1 Y1 X2 Y2 ... XB YB

where $3 \le B \le 1000$ is the number of border points and each $X_i,Y_i$ is the coordinate of the $i$-th border point. The border consists of the segments between points $i$ and $i+1$, and between points $B$ and $1$.

The second line gives the informers:

N X1 Y1 X2 Y2 ... XN YN

where $1 \le N \le 1000$ is the number of informers and $X_i,Y_i$ is the location of the $i$-th informer.

The third line describes the radars:

M X1 Y1 R1 X2 Y2 R2 ... XM YM RM

where $1 \le M \le 30$ is the number of radars, $X_i,Y_i$ is the centre of the $i$-th radar, and $R_i$ is its radius.

All coordinates are integers with $0 \le X, Y \le 1000$, and every radius is an integer with $1 \le R \le 1000$. A test case with $B = N = M = 0$ marks the end of the input and must not be processed. Every radar centre and every informer lies inside the border, but the area covered by the radars may extend outside it.

Output

For each test case, print one line containing either Mission impossible or Contact informer K, where K is the input index of the reachable informer with the highest insider-coefficient. If several reachable informers share the highest insider-coefficient, choose the one with the smallest index.