SMPCIRC - Two Circles

Given two circles: O1 with the center o1 = (x1, y1) and a radius r1 and O2 with the center o2 = (x2, y2) and radius r2, please compute if O1 is inside O2 or if O2 is inside O1.

Input

First t < 1000, the number of test cases. In each of the following t lines, 6 integers: x1 y1 r1 x2 y2 r2. Where 0 ≤ x1, y1, x2, y2 ≤ 10000 and 0 < r1, r2 ≤ 10000.

Output

For each test case print one character:

  • I, if O1 is inside O2 (or if O2 is inside O1),
  • E, if O1 is internally tangent to O2 (or if O2 is internally tangent to O1),
  • O, in other cases.

Example

Input:
2
103 104 5 100 100 10
103 104 10 100 100 10

Output:
E
O

Added by:kuszi
Date:2013-08-26
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2016-01-09 18:44:54
if O1=O2 then O will be taken
2015-11-27 04:54:04 Siu Ching Pong (Asuka Kenji)
@acakaacaka: If two circles are the same, it should be considered "E".
2015-10-28 16:33:49
how if O1 = O2 is it I or E or O
2015-09-29 18:48:48
Working

Last edit: 2015-09-29 19:04:52
2015-09-29 05:06:01 Kevin Smild Báez Lugo
Is the first case's answer correct?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.