G - Banning Balconing  

Context

This summer many young people have died or been seriously injured for practicing the odious craze of balconing, i.e., jumping from the balcony of a hotel to the pool. In order to prevent this problem, you have been hired to program an app to show the risks of balconing. Even in the case that you fall into the pool, you could suffer a hard hit with the water. If you fall on the floor, you would probably die. And if you fall near the edges of the pool, you could suffer serious injuries.

The Problem

We know the height of the balcony (H), the horizontal distance from the balcony to the pool (D), and the length of the pool (L), as shown in the following figure.

Balconing

The person jumps with an initial horizontal speed V (the initial vertical speed is supposed to be 0). The gravity is supposed to be 9.81 m/s2.

You have to determine if the person would fall on the floor, or 50 cm away from an edge of the pool (at any side), or into the pool.

The Input

The input starts with a natural number indicating the number of test cases.

Each test case is contained in a line with 4 integer numbers separated by blank spaces: L (length of the pool, in millimeters), D (horizontal distance, in millimeters), H (height, in millimeters) and V (horizontal speed, in millimeters/second). These numbers will not be negative.

The Output

For each test case, you have to output a line with:

Sample Input

5
7000 3000 5000 1500
5500 2000 8000 4000
6250 1000 3000 750
3000 300 10000 600
3000 500 10000 600

Sample Output

FLOOR
POOL
EDGE
POOL
EDGE

OMP'14
Facultad de Informática
Universidad de Murcia