Novice programmer Vasya develops his own vector graphics editor.
In addition to the usual primitives (like rectangles, circles, straight lines)
his editor also supports working with objects of complex shapes,
which are described using spline curves.

Each such curve consists of several pieces, in sequence one after the other,
each of which is given by a parametric equation of the following form:

where t — scalar parameter, changing in range of [0, 1].

Vasya uses closed spline curves to describe complex shapes.
One of his tasks is to determine for every given point
whether it lies inside such a figure.

Input format

The beginning of the input contains an integer N,
followed by 8 × N real numbers,
specifying the coefficients of the corresponding splines