BlueBook
Given an integer
, print out the closest compass bearing
to that integer if
is the bearing in degrees. If there is a tie, print
the "smaller" of the two possible outputs.
The bearings arranged in increasing order of "size" are: N
, E
, S
, W
.
This means choose N
over E
if the input is , and
N
over W
when the
input is .
Input Specification
The input consists of an integer
, denoting the number
of test cases and then each line following consists of one integer
.
Output Specification
Output the closest compass bearing according to the input.
Sample Input
2
45
180
Sample Output
N
S
Comments