Count Offline#2951

Count Offline

2 seconds
256 megabytes
Easy (≈1000)

You are given a set of points on a plane.

You need to process two types of queries:

Input

The first line contains the number of points (1 \le N \le 50000). Each of the next lines contains the coordinates of a point. Then follows the number of queries (1 \le Q \le 100000), followed by queries. All coordinates are integers from to 10^9 inclusive.

Output

For each query of type ?, output a single integer — the number of points inside the specified rectangle.

Examples

Example 1

Loading
Loading