Aim It Right!

No attempts yetTime limit1sMemory limit128 MB

Problem

The humans and the Na'vi share many cultural and lifestyle similarities. For instance, their sports and board games resemble various games on Earth. Yet there are striking differences too (for example, instead of water polo they ride their Banshees and play air polo). They even have a version of Billiards very much like ours, with one difference: their Billiards table has a large circular hole right at its centre (see the figure). Naturally, whoever knocks a ball into that hole loses at once.

Jake and Tsu'tey start a friendly game of Billiards that soon turns into a not-so-friendly one, with the leadership of the Omaticaya possibly at stake. In each round the two take turns. On a turn, an impartial judge places the cue ball at one spot on the table (call it point A) and another ball at a different spot (call it point B). The player whose turn it is must strike the ball at B from the ball at A using the minimum number of rebounds off the walls (see the figure).

Help Jake win and keep his leadership. Given the input, find the minimum number of rebounds needed to travel from point A to point B, or report that it is impossible. Assume the table is perfectly frictionless and the walls are perfectly elastic, so a ball that strikes a wall at an angle $\theta$ rebounds in the opposite direction at exactly the same angle.

Input

The Billiards table is a square 100 units on a side. Assume the centre of the table (and therefore the centre of the hole in the middle) is at (0, 0). You are given the x and y coordinates of points A and B, together with the radius r of the central hole.

The first line of the input is the number of test cases. Each following line contains five integers Ax, Ay, Bx, By, r, where (Ax, Ay) are the coordinates of point A, (Bx, By) are the coordinates of point B, and r is the radius of the hole. Neither point A nor point B lies inside the hole, and r < 50.

Output

For each test case, find the minimum number of rebounds needed to reach point B from point A. If it is less than 10, print REBOUNDS followed by the required number of rebounds on a single line. If point B cannot be hit from point A in fewer than 10 rebounds, print NOT POSSIBLE on a single line.

Hint