A polygon is drawn on the plane so that all its vertices have integer coordinates, and each side is parallel to one of the coordinate axes. Someone erased all the horizontal sides of this polygon, leaving only vertical sides. Your task is to determine the perimeter and the area of the original polygon.
The first line contains an integer — the number of vertical sides. Each of the next lines contains three integers , Y_1, Y_2, describing a vertical side with endpoints (X, Y_1) and (X, Y_2).
Constraints: N < 10000; |X| \leq 1000; |Y| \leq 1000, where (X, Y) are the coordinates of the vertices. The sides of the polygon do not intersect, and each vertex belongs to exactly two sides of the polygon.
Output two numbers: and .
Example 1