Byteman belongs to the resistance that fights the Evil Emperor occupying Byteland. He is lithe and nimble, so he was picked for the mission of slipping into the Imperial Palace and taking the Emperor's secret blueprints. After a long look at every way into the Palace he settled on the sewers.
The trouble is that the city sewers are cut off from the sewers under the Palace by thick iron bars. So Byteman decided to pass the first line of guards through the city sewers, come up through a gutter on the Imperial Plaza (the huge courtyard of the Palace itself), and then go down a different gutter into the Palace sewers on the other side of the bars.
Watchmen patrol the Imperial Plaza. Each watchman patrols a segment connecting two points. He walks at constant speed from point A to point B, makes a sharp turn on the spot without looking around, walks from B back to A, turns again, and repeats. The Emperor is keen on smart drill, not necessarily sensible drill, so he ordered every watchman to turn at the same moment, once every minute. A watchman assigned to a segment of length ℓ therefore moves ℓ per minute.
Byteman knows the segment of every watchman. He can sneak at 10 bytefeet per minute. His special black cloak leaves the watchmen no chance of seeing him while he stands still. If he moves while in the view of any watchman, he is spotted and caught. In particular, he cannot enter or exit a gutter at a moment when it is in the view of any watchman. The watchmen see infinitely far, but they have no eyes in the back of their heads, so they see only what lies in the closed 180∘ angle in front of them. Assume the Imperial Plaza is infinitely large.
Byteman is not sure that every gutter is usable. To improve his chances he wants to count, for each gutter he can use to leave the city sewers, how many Palace gutters he can reach from it. There are far too many gutters for him to do this alone, so he asks for your help.
The first line contains three integers n, m and p (1≤n,m,p≤105), separated by single spaces, denoting the number of watchmen, the number of gutters leading to the city sewers, and the number of gutters leading to the Palace sewers.
The next n lines describe the patrolled segments. Each line contains four integers x1, y1, x2, y2 (−2×107≤x1,y1,x2,y2≤2×107), separated by single spaces, meaning that this watchman patrols the segment between (x1,y1) and (x2,y2). The two points are distinct. At the start the watchman stands at (x1,y1) and faces (x2,y2). The coordinate system is chosen so that the distance between (0,0) and (1,0) is one bytefoot.
The next m+p lines give the positions of the gutters. Each line contains two integers x and y (−2×107≤x,y≤2×107), separated by a single space, meaning that the gutter is at (x,y). The first m lines describe the gutters connected to the city sewers, the next p lines the gutters connected to the Palace sewers.
The input is chosen so that the answer would not change if each gutter were moved by at most 10−7 bytefoot.
Write m lines. The i-th line should contain a single integer, the number of gutters connected to the Palace sewers that can be reached from the gutter given i-th in the input.
In the first example the first gutter is in the view of some watchman the whole time. The second watchman starts looking at it at the very moment the third watchman turns his back to it.
Both Palace gutters are reachable from the second gutter. For the first one it is enough to wait a minute and 42 seconds until the first watchman loses the gutter (5,6) from view. The second and third watchmen lose it earlier. The remaining 18 seconds are enough to walk calmly to the gutter (5,8).
Reaching the gutter (7,4) takes a bit more work. Leave the gutter after 102 seconds again, but this time spend the 18 seconds left before the watchmen turn around on reaching the point (5.5,4.5). Wait there for 30 seconds, then run freely to the gutter (7,4).