#00010F

WKTPoligon

You are given a polygon in the following (well known) text format (WKT): POLYGON ((x1 y1, x2 y2, x3 y3, ... , xN yN)), where x1 y1 and xN yN are equal (represent the same point), and N>3. You have to determine if that polygon could represent a geographical object in lat-lon coordinates. Lat coordinate represents the latitude from the interval [-90..90], and lon coordinate represents the longitude from the interval [-180..180]. The question is whether the given text can represent a geographical object. The condition is that the one of the coordinates represents the latitude (-90..90), and the other ones represent longitude (-180..180). Because the standard is not specific, we can have that x coordinates represent latitude, and y longitude, or vice-verse. In all the inputs the all the x coordinates will always represent either latitude or longitude.


InputFrom the first line of the standard input read the polygon description in the WTK format. The number of points of the polygon will be at most 1000. The coordinates will be real numbers from interval [-1000, 1000] each containing at most 5 decimal digits.

OutputTo the standard output write DA if the input WTK can represent a geographical polygon, and NE if it can not.

Input:
POLYGON ((0 120, 0 -120, 0 0, 0 120))
Output:
DA

Input:
POLYGON((123.44 22.2, 12.24 98.11, 12.26 99, 123.44 22.23, 123.45 22.2))
Output:
NE

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.