Five-pointed Queries
시간 제한3초메모리 제한1024 MB
볼록 k각형(k ≤ 30)의 꼭짓점에 통신탑이 있고, 내부의 가입자가 활성 상태를 토글하며, 다섯 탑이 만드는 오각형 안에 들어가는 활성 가입자 수를 묻는 질의에 답한다.
문제
Nowadays, the 5G mobile communication standard is being introduced everywhere. But progress does not stand still, and the researchers of the Lucifer Laboratory are working hard to develop a new communication standard. The development turns out to be so innovative that it was decided to call the new standard not 6G, but immediately 666G. Researchers claim that this technology will make it possible to call Satan himself.

The new technology can be described as follows. The comminication towers, which can be considered points on the plane, are located at the vertices of a convex -gon. Any five pairwise different towers are the tops of a five-pointed star and allow serving subscribers inside a pentagon, which is bounded by edges of the five-pointed star.
You task is to test the load on communication towers using a model example. Let there be subscribers who can be considered as points on the plane inside the convex -gon formed by the communication towers. We will assume that subscribers do not change their location. For each subscriber it is known whether he is active or not.
Further, there are events of two types, ordered chronologically:
- Subscriber numbered changes its activity. That is, if the subscriber was active, then he becomes inactive and vice versa.
- For some five pairwise different communication towers, it is necessary to determine the number of active subscribers who are served by these five towers.
You need to simulate all events and respond to all requests of type .
입력
The first line contains an integer --- the number of communication towers ().
The -th of the following lines contains two integers and --- coordinates of the -th communication tower. It is guaranteed that the communication towers are at the vertices of a strictly convex -gon, that is, no three towers are on the same straight line. The towers are listed in clockwise order of traversing this -gon.
Further on a separate line is an integer --- the number of subscribers ().
The -th of the following lines contains three integers , and --- the coordinates of the -th subscriber and his activity. means that the -th subscriber is active, --- that he is not. It is guaranteed that all subscribers are strictly inside the convex -gon formed by communication towers. No subscriber is on the segment that connects any two communication towers.
Further on a separate line is an integer --- the number of events ().
The -th of the following lines describes the -th event. An event of type is written as " ", where is the number of the subscriber for which the activity is changing (). An event of type is written as " ", where , , , and --- tower indexes for which you need to determine the number of active served subscribers ().
It is guaranteed that there is at least one request of the type .
The coordinates of all points are integers not exceeding in absolute value. No two points in the input are equal.
출력
Print lines, where is the number of events of type . In the -th line, print one integer - the answer to the -th query of the type .
힌트
The point configuration in the example is shown on picture above.