I. Polycarp and Heat Exchangers
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

Polycarp does experiments again. He has N triangle heat exchangers on the field. Each i-th heat exchanger has input and output and their coefficients kini and kouti respectively. If two heat exchangers intersect (or first one touches second one), then thir inputs becamee molten together and their input coefficient became k, where , k1 and k2 are input coefficients of heat exchangers. Each point of field emits heat, heat comes out with specific speed. If this point is beneath some heat exchangers, it's value is multiplied by final value of their input coefficient and then it's multiplied by their output coefficients. Square of field with sides's length 1 emits 1 unit of heat. Polycarp wants to know value of heat per second, which emits all heat exchangers.

Input

The first line contains N, 1 ≤ N ≤ 10. N lines follow, each containing x1i, y1i, x2i, y2i, x3i, y3i, kini, kouti — coordinates of vertexes i-th heat exchanger, input and output coefficients. All numbers are separated by space, coordinates are integers, which are lesser than 101 and greater than  - 101, 0.1 ≤ kini, kouti ≤ 2.0. Triangles are not degenerate.

Output

Output summary value of heat per second, which emits all heat exchangers. You may assume that answers is coparated with the precision of 10 - 4.

Examples
Input
2
0 0 4 4 8 0 1 1
1 3 7 3 4 -1 1 1
Output
9.51785700
Input
2
-100 100 -100 -100 75 -100 0.5 2
100 100 100 -100 -75 -100 0.5 2
Output
17500.00000000