Wheels

No attempts yetTime limit1sMemory limit256 MB

Problem

A complicated machine is made of nn wheels, numbered 1 to nn. They are really cogwheels, but the cogs are so small that each wheel is modeled as a circle in the plane. Every wheel spins around its own center.

Two wheels never overlap, which means they share no interior point, but they may touch. When two wheels touch and one of them turns, the other turns as well, because their tiny cogs are locked together.

A force is applied to wheel 1 and to no other wheel, turning it exactly one turn per minute, clockwise. Find how fast every other wheel turns. You may assume the machine is not jammed, so the motion described by the input really happens.

Input

The first line contains the number of test cases TT.

Each test case starts with a line holding the number of wheels nn (1n10001 \le n \le 1000). Each of the next nn lines contains three integers xx, yy and rr (10000x,y10000-10000 \le x, y \le 10000; 1r100001 \le r \le 10000), where (x,y)(x, y) is the center of the wheel and rr is its radius. The wheels are numbered 1 to nn in the order they are given.

Output

For each test case print nn lines. Line ii describes how wheel ii moves.

If the wheel turns, print p/q clockwise or p/q counterclockwise, where the irreducible fraction p/qp/q is the number of turns per minute. If qq is 1, print the integer pp instead of the fraction. If the wheel stands still, print not moving.