e-olymp
Competitions

Геометрия - 1

Intersection of two lines

Find the intersection point of two lines. Each line is given with the pair of points on it.

Input

Two lines are given. Each line contains four integers, not greater than 100 by absolute value - the coordinates of the points specifying the lines.

Output

Print in the first line 0 if lines do not intersect, print 1 if lines intersect in one point and print 2 if lines coincide. If the lines intersect each other and do not coincide, print in the second line the coordinates of intersection point with 7 digits after the decimal point.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1 0 2 2
0 1 1 2
Output example #1
1
3 4