Problem A - Little Boxes

Call a rectangular parallelepiped in 3-space a regular box if its edges are parallel to the coordinate axes. A regular box can be specified by giving the coordinates of the two points at the ends of one main diagonal (a diagonal that does not lie within any face).

In this problem, you will be given some regular boxes and some points, about which you will compile some information.

INPUT: Specifies N regular boxes and M points:

Line 1 An integer N, representing the number of regular boxes subsequently specified.
Next N lines Six integers per line, the x, y and z coordinates of one point, followed by the x, y and z coordinates of a second point, these points specifying a regular box.
Next line An integer M, representing the number of points subsequently specified.
Next (final) M lines Three integers per line, the x, y and z coordinates of a point.

All numbers within a line will be separated by a single space, and there will be no spaces after the last number in a line. All the coordinates given will be between -30,000 and 30,000, each box will have positive volume, and there will be no duplicate boxes or duplicate points specified.

In the output specifications, the words point(s) and box(es) refer to the points and regular boxes specified in the input.

OUTPUT: Reports statistics about the relationships between the points and the boxes, as follows:

Line 1 The greatest number of points lying within a single box.
Line 2 The greatest number of boxes within which a single point lies.
Line 3 The number of boxes that contain no point.
Line 4 The number of points that lie within no box.

Your output should contain numbers only, without explanatory words or space characters. You should consider a point lying on a face or edge of a box not to be contained within that box.


Example

Input File:

2
0 0 0 9 9 9
-1 2 4 5 -3 11
3
2 2 2
0 1 9
0 0 0

Output File:

1
1
0
1


Scanned and beautified by onTy Toom, onty@acm.org