PROBLEM STATEMENT
Given N rectangles with their sides parellel to x and y axes of a two dimensional cartesian co-ordinate system (with each rectangle represented by the four co-ordinates) and M query points. You have to find perimeter of the area enclosing each query point. If the area enclosed is unbounded, print -1.

Input Format:
Line 1: N
Line 2: X11 Y11 X12 Y12 X13 Y13 X14 Y14
Line 3: X21 Y21 X22 Y22 X23 Y23 X24 Y24
Line 4: X31 Y31 X32 Y32 X33 Y33 X34 Y34
......
......
Line N+1: XN1 YN1 XN2 YN2 XN3 YN3 XN4 YN4
Line N+2: M
Line N+3: X11 X12
......
......
Line N+M+2: XM1 XM2

Output Format:
Line 1: P1
Line 2: P2
......
......
Line M: PM