Wedding Selfie

A convex polygon pinned at its first vertex rotates about the origin until the Y-axis halves its area, with ties broken by the most area below the X-axis.

Medium7GeometryMathBinary searchNo attempts yetTime limit3sMemory limit256 MB

Problem

At his wedding, Daryl took a selfie with his bride. Both of them liked the photo enough to hang it on the wall of their new home. The photo has the shape of a convex polygon with NN vertices.

Daryl's brother Merle offered to hang it. Merle drove in NN nails, one at each vertex, but only the first nail was tightened properly. The other nails were loose and did not hold for long, so Daryl soon found the photo dangling from that single tight nail.

The photo turns freely around the tightened vertex. It settles once the area of the polygon to the right of the Y-axis equals the area to the left of the Y-axis. If several positions satisfy that, the photo settles in the position with the largest area below the X-axis. Find the coordinates of the vertices after the photo settles.

Input

The first line contains the number of test cases TT (1T1001 \le T \le 100). Each test case starts with a line holding the number of vertices NN (3N1003 \le N \le 100). The next NN lines each contain two integers XiX_i and YiY_i (1000Xi,Yi1000-1000 \le X_i, Y_i \le 1000) separated by one space, the coordinates of the ii-th vertex.

The vertices are given in counter clockwise order, and the first vertex is the one Merle tightened. The first vertex is always (0,0)(0, 0). No three consecutive vertices lie on one line. Every given polygon is convex, and all of its interior angles are smaller than 180180 degrees.

Output

For each test case print a line with "Case n:", where nn is the test case number starting from 11. Then print NN lines with the new coordinates of the vertices, in the same order as the input. Each line holds XiX_i and YiY_i separated by one space, rounded to exactly six digits after the decimal point. Print 0.000000 instead of -0.000000. The settled position is uniquely determined.