Imprecise Location

A reverse geocoding service maps coordinates to geographic regions. In this problem, you must implement such a service.

You are given NN geographic regions. Each region is an axis-aligned rectangle in the plane: its sides are parallel to the coordinate axes. It is described by two opposite corners (X1,Y1)(X_1,Y_1) and (X2,Y2)(X_2,Y_2), with X1<X2X_1 < X_2 and Y1<Y2Y_1 < Y_2. For any two regions, either one is strictly contained in the other or they are disjoint. Their boundaries do not touch or cross.

The service must answer QQ location queries. Each query is given by three integers XX, YY and RR. The point (X,Y)(X,Y) is the measured location, and RR describes the uncertainty of the measurement: the actual location can be any point inside or on the boundary of the axis-aligned query square with opposite corners (X−R,Y−R)(X-R,Y-R) and (X+R,Y+R)(X+R,Y+R). When R=0R=0, the query square consists of the single point (X,Y)(X,Y).

It is guaranteed that no corner of a query square lies on the boundary of any region. However, the boundary of a query square may intersect region boundaries.

For each query, determine the region of smallest area that is guaranteed to contain the actual location. In other words, find the region of smallest area that contains the entire query square, or report that no such region exists.

Input

The first line contains an integer NN (1≤N≤2×1051 \leq N \leq 2 \times 10^{5}) indicating the number of geographic regions. Each region is identified by a distinct integer from 11 to NN.

The ii-th of the next NN lines describes region ii with four integers X1X_1, Y1Y_1, X2X_2 and Y2Y_2 (−109≤X1,Y1,X2,Y2≤109-10^{9} \leq X_1,Y_1,X_2,Y_2 \leq 10^{9}, X1<X2X_1 < X_2 and Y1<Y2Y_1 < Y_2), where (X1,Y1)(X_1,Y_1) and (X2,Y2)(X_2,Y_2) are two opposite corners of the corresponding rectangle.

The next line contains an integer QQ (1≤Q≤2×1051 \leq Q \leq 2 \times 10^{5}) indicating the number of location queries.

Each of the next QQ lines describes a query with three integers XX, YY and RR (−109≤X,Y≤109-10^{9} \leq X,Y \leq 10^{9} and 0≤R≤1090 \leq R \leq 10^{9}), representing the query square with opposite corners (X−R,Y−R)(X-R,Y-R) and (X+R,Y+R)(X+R,Y+R). The corners of this square may lie outside the coordinate range given for XX and YY.

Output

For each query in the input, output a line with an integer identifying the region of smallest area that contains the entire query square. If no region contains the entire query square, output a line with the character “*” (asterisk) instead.

Examples

Input

2
0 0 10 10
2 2 6 6
3
4 4 1
4 4 3
9 5 2

Output

2
1
*

Explanation

Solid rectangles: regions

Qi: i-th query (square or point)

Q1 → 2
Q2 → 1
Q3→ *

Input

3
2 2 4 4
8 0 14 6
0 0 6 6
4
3 3 0
1 1 0
11 3 1
7 3 2

Output

1
3
2
*

Explanation

Q1 → 1
Q2 → 3
Q3 → 2
Q4→ *

Input

1
-1 -1 1 1
3
0 0 0
1 3 0
0 0 2

Output

1
*
*

Explanation

Q1 → 1
Q2→ *
Q3→ *