Hide and seek

No attempts yetTime limit5sMemory limit128 MB

Problem

A group of kids is playing hide and seek in a playground. Each kid is either a hiding kid or a seeking kid. A hiding kid only tries not to be found, while a seeking kid tries to find other kids, both the hiding ones and the seeking ones.

Hiding kids and seeking kids alike would rather not be found, so they keep the walls of the playground between themselves and everyone else. Each wall is a line segment and each kid is a point in the XYXY plane. Two kids see each other exactly when the segment joining them crosses no wall segment.

For every seeking kid, count how many other kids that kid can see. To keep the problem simple, assume two things. No two walls meet, not even at their endpoints. And no three points are collinear in the set of all kid positions together with all wall endpoints, so no kid stands on a wall and no two kids share a position.

Input

The first line contains three integers SS, KK and WW: the number of seeking kids, the total number of kids, and the number of walls in the playground (1S101 \le S \le 10, 1K,W1041 \le K, W \le 10^4, SKS \le K).

Each of the next KK lines contains two integers XX and YY (106X,Y106-10^6 \le X, Y \le 10^6), meaning that this kid stands at the point (X,Y)(X, Y) of the XYXY plane. The first SS of these lines describe the seeking kids.

Each of the next WW lines contains four integers X1X_1, Y1Y_1, X2X_2 and Y2Y_2 (106X1,Y1,X2,Y2106-10^6 \le X_1, Y_1, X_2, Y_2 \le 10^6), meaning that this wall has endpoints (X1,Y1)(X_1, Y_1) and (X2,Y2)(X_2, Y_2). Wall segments never intersect, and no three of the given points are collinear.

Output

Print SS lines. On the ii-th line print the number of other kids that the ii-th seeking kid can see.