We have four points $A$, $B$, $C$, and $D$ on the plane. These four points define a polygon as in the following figure. Note that all segments in the simple polygon are vertical or horizontal.
Now write a program to calculate perimeter and area of the polygon defined by the four points $A$, $B$, $C$, and $D$. For example, the perimeter and the area of the figure above should be 20 and 16 respectively. Note that to make the perimeter and area well-defined we assume that point $D$ does not appear in the right bottom corner of point $B$. In other words, if the coordinates of point $B$ is $(Bx, By)$ and the coordinates of point $D$ is $(Dx, Dy)$, then $Dx$ is smaller than $Bx$ or $Dy$ is greater than $By$.
The input has eight lines for the x and y coordinates of points $A$, $B$, $C$, and $D$. The coordinates are all between -10000 and 10000.
The output has two lines for the perimeter and the area of the simple polygon.