A nearby pasture can be represented as a rectangular grid consisting of 10^6 rows and 10^6 columns. The rows are numbered with integers from through 10^6 from top to bottom, and the columns are numbered with integers from through 10^6 from left to right.
A herd of cows is scattered throughout the grid, with each cow occupying a single unit square. The pasture also contains dandelion flowers, which the cows like, with each flower occupying a single unit square. Finally, the pasture contains fences, each of which forms a rectangle along the edges of unit squares. No two fences intersect or touch. However, one fence may be located entirely inside the area enclosed by another fence.
Due to unfavorable wind conditions, cows can move in only two directions: down or right. Cows can move through squares occupied by other cows or flowers, but they cannot cross fences.
For each cow, determine the total number of flowers that are reachable from its current location.
Consists of three blocks. The first block describes the fences, the second describes the flowers, and the third describes the cows.
The first line of the first block contains an integer f~(0 \le f \le 200,000) — the number of fences. Each of the following lines contains four integers r_1, c_1, r_2, c_2~(1 \le r_1, c_1, r_2, c_2 \le 10^6) describing a single fence.
Here, r_1 and c_1 are the row and column coordinates of the upper-left unit square inside the fence, while r_2 and c_2 are the row and column coordinates of the lower-right unit square inside the fence.
No two fences intersect or touch.
The first line of the second block contains an integer m~(0 \le m \le 200,000) — the number of flowers. The -th of the following lines contains two integers and c~(1 \le r, c \le 10^6) — the location of the -th flower.
No two flowers occupy the same square.
The first line of the third block contains an integer n~(1 \le n \le 200,000) — the number of cows. The -th of the following lines contains two integers and c~(1 \le r, c \le 10^6) — the location of the -th cow.
No two cows occupy the same square, and no square contains both a flower and a cow.
Print lines. The -th line should contain one integer — the total number of flowers reachable from the location of the -th cow.
Example 1