Shoring Up the Levees#535

Shoring Up the Levees

1 second
64 megabytes
Medium

The tiny country of Waterlogged is protected by a series of levees that form a quadrilateral as shown below:

The quadrilateral is defined by four vertices. The levees partition the country into four quadrants. Each quadrant is identified by a pair of vertices representing the outside edge of that quadrant. For example, quadrant 1 shown below is defined by the points (x_1, y_1) and (x_2, y_2).

It happens very often that Waterlogged becomes flooded, and the levees need to be reinforced, but the country has limited resources. They want to reinforce, in order, the levees that encompass the largest area first, then the next largest, then the third largest, and finally the smallest.

Help Waterlogged identify which quadrants are the largest and the length of the levees around them.

Input

There will be several sets of input. Each set consists of eight real numbers, in one line. These numbers represent, in order:

X_1\ Y_1\ X_2\ Y_2\ X_3\ Y_3\ X_4\ Y_4

The four points are guaranteed to form a convex quadrilateral in order, with no concavities and no crossing lines. Every number will be in the range from to inclusive. No quadrant will have an area or perimeter smaller than . The end of the input is indicated by a line with eight 's.

Output

For each input set, print a single line with eight floating point numbers. These represent the areas and perimeters of the four quadrants as follows:

A_1\ P_1\ A_2\ P_2\ A_3\ P_3\ A_4\ P_4

Print them in order from largest area to smallest, so A_1 is the largest area. If two quadrants have the same area rounded to decimal places, print the one with the larger perimeter first. Print all values rounded to decimal places. Insert spaces between numbers. Do not print blank lines between the outputs.

Examples

Example 1

Loading
Loading