Bathtub#6303

Bathtub

1 second
64 megabytes
Very hard

Newlywed programmers went to a store to choose a bathtub and found that, due to the complex shapes of the bath bottoms, it was unclear to them to what height the water would rise in each if the same volume of water were poured in. They took photos of the bathtubs from different angles and later modeled them at home on their computer. Soon, they constructed triangulations of the bathtub surfaces, and all that remained was to compute the water height for a given volume.

All constructed surface triangulations are simply connected and contain only triangles whose projections onto the -plane neither intersect nor degenerate into a segment. Furthermore, the bathtub bottom does not contain local maxima, and horizontal sections can only occur at the maximum depth. To simplify the description, the newlyweds did not specify external vertical boundaries, considering the given surface to be surrounded by vertical walls whose top edge coincides with zero depth.

Input

The first line contains two natural numbers separated by at least one space: (1 \le n \le 200) — the number of vertices in the triangulation, and (1 \le m \le 400) — the number of triangles. Each of the next lines contains the triangulation's vertices, with real numbers per line: the coordinates in meters, where each coordinate ranges from to , and the third coordinate represents the depth at that point. Each of the next lines contains a triangle, represented by natural numbers per line: each number is the index of a triangulation vertex. The last line contains one natural number — the volume of water poured, measured in liters. Water is always poured such that the height of its rise does not exceed the maximum depth of the bathtub.

Output

Print one real number, rounded to three decimal places in fixed-point format: the height the water rises relative to the deepest point of the bathtub.

Examples

Example 1

Loading
Loading