Intersection of two lines#5134

Intersection of two lines

1 second
128 megabytes
Easy

Find the intersection point of two lines. Each line is defined by a pair of distinct points lying on it.

Input

Each of the next two lines contains four integers, the coordinates of two distinct points on a line. The integers in each line are x_1\ y_1\ x_2\ y_2, |x_i| \leq 100, |y_i| \leq 100.

Output

Print 0 if the lines do not intersect. Print 1 if the lines intersect at exactly one point, and print 2 if the lines coincide.

If the lines intersect at exactly one point, print in the second line the coordinates of the intersection point with digits after the decimal point.

Examples

Example 1

Loading
Loading