A classic compass rose is divided into 360°. The four cardinal directions are on the main axes, and are respectively called north, east, south and west (see figure).

compass rose
Compass rose with subdivisions in degrees and mil1 (inner scale).

These cardinal directions cover areas of ±45° around the main axes (see tabel). They are simply used to indicate a well-defined direction anywhere in the world. North and south face their respective poles near the ends of the Earth axis. The rotation of the Earth around that axis is used to define the eastward and westward directions.

direction area
north [0°,45°[ and [315°,360°[
east [45°,135°[
south [135°,225°[
west [225°,315°[

Assignment

Define a class Compass that can be used to create instances of compasses. The needle of the compass gives the angle $$a \in {\mathbb{Z}}$$ (expressed in degrees), where $$0 \leq a < 360$$. The objects of the class Compass must at least support the following methods:

Example

>>> compass = Compass()
>>> compass
Compass(0)
>>> compass.direction()
'north'
>>> print(compass)
0° (north)e

>>> compass.turn(222)
>>> compass
Compass(222)
>>> compass.direction()
'south'
>>> print(compass)
222° (south)

>>> compass.turn(157)
>>> compass
Compass(19)
>>> compass.direction()
'north'
>>> print(compass)
19° (north)