Newton and the Apple

Given four sorted x-axis positions and a circle high above, print the index of the person the falling apple touches, or 0 for none.

Medium4GeometryMathImplementationNo attempts yetTime limit1sMemory limit32 MB

Problem

People waiting for the apple to fall.

Four people wait for an apple to fall, as in the picture. Everyone stands still at a point on the xx-axis, and no two people stand at the same point. Person ii (1i41 \le i \le 4) stands at the point (pi,0)(p_i, 0). A person is small compared with the coordinate plane, so ignore each person's size.

The people waiting on the xx-axis.

The apple is a circle of radius rr centred at the point (x,y)(x, y). It hangs still in the air right now, so every point of the apple is above the xx-axis, that is, in the region y>0y > 0.

The apple floating above the xx-axis.

Only gravity in the y-y direction acts on the apple. Gravity is constant, so the apple moves toward the ground, the xx-axis, with constant acceleration, and it stops the moment it touches the xx-axis.

The apple falling toward the xx-axis.

The people wait for the apple, but none of them wants to be hit, so they want to know who collides with it. Given the positions of the people and the centre and radius of the apple, write a program that decides whether anyone collides with the apple, and if so, who.

Input

The first line contains four integers p1p_1, p2p_2, p3p_3, p4p_4 (109p1<p2<p3<p4109-10^9 \le p_1 < p_2 < p_3 < p_4 \le 10^9), separated by spaces, giving the positions of the people. Person ii (1i41 \le i \le 4) stands at (pi,0)(p_i, 0).

The second line contains three integers xx, yy, rr (109x109-10^9 \le x \le 10^9, 0<y1090 < y \le 10^9, 1r1091 \le r \le 10^9), separated by spaces, describing the apple. Its centre is the point (x,y)(x, y) and its radius is rr. The apple is guaranteed to float above the xx-axis, that is, y>ry > r.

Output

Print the number of the person who collides with the apple on the first line. If nobody collides with it, print 0 instead.