Brio got his house constructed near the National Highway. The Construction and Planning Committee has planned to construct a road near his house. Brio is worried about the Committee's plan as he fears that his house might come on the way of the road being constructed. In such a case, he needs to request the Committee members to replan the construction. Assume that Brio's house is a circle with center at (0,0) and radius r. Given 2 integral points (x1,y1) and (x2,y2) through which the road passes you need to give output as mentioned below:
if the road crosses his house, print "REPLANNING" (quotes for clarity). if the road just touches his house, print "JUST MISSED" if the road is far off his house, print "SAFE"
INPUT
The first line of the input contains the number of testcases T. Each of the next T test cases has 2 lines, the first containing 4 space separated integers x1 y1 x2 y2 and the second line contains r.
OUTPUT
One line per test case containing the required output.
CONSTRAINTS
T<=10000
-10000 <= x1 y1 x2 y2 <= 10000
r <= 10000