# Power of Thor The final battle of Ragnarök, the twilight of the gods is approaching. You incarnate Thor who is participating in this final battle against all the forces of evil, led by Loki, Thor's wizard brother. Thor was wounded during a previous battle against Fenrir, the wolf-god. During the battle, Loki took advantage of the general confusion and used his magic to annihilate the magical powers of Thor’s hammer, Mjöllnir, by separating it from his soul: the light of power. Thor, who now feels very weak, must find and reach the light of power, as fast as possible, since it is the only thing which can restore his and Mjollnir’s powers. ## The Program You move on a map which is 40 wide by 18 high. Thor is initially placed on a random spot on the map and must reach the light of power as quickly as possible. During each turn, you must specify in which direction to move, from one of the following: * **N** (North) * **NE** (North-East) * **E** (East) * **SE** (South-East) * **S** (South) * **SW** (South-West) * **W** (West) * **NW** (North-West) _You win when Thor reaches the light of power._ ### You lose: * if Thor moves off the map. * or if Thor doesn't have enough energy left to reach the light of power. The program must first read the initialization data from standard input. Then, within an infinite loop, read the data from the standard input related to Thor's current state and provide to the standard output Thor's movement instructions. Don’t forget to run all the tests by modifying the value of the “test” variable _(1, 2, 3, 4)_ in the “Test script” window The tests provided are similar to the validation tests used to compute the final score but remain different. ## Initialization Input * **Line 1**: 4 integers _LX LY TX TY_. * _(LX, LY)_ indicate the position of the light of power. * _(TX, TY)_ indicate Thor’s starting position. ## Input / Game Turn * **Line 1**: The level of Thor’s remaining energy E. This represents the number of moves he can still make. ## Output / Game Turn * **A single line** providing the move to be made: ``N NE E SE S SW W or NW`` ## Constraints * 0 ≤ LX < 40 * 0 ≤ LY < 18 * 0 ≤ TX < 40 * 0 ≤ TY < 18 * 0 < E ≤ 100 * Response time for a game turn ≤ 100ms ## Example * Thor starts on the map on the square _(3, 6)_. * The light of power is on square _(3, 8)_. * Initialization input (out of the infinite loop) No output expected: * ``3 8 3 6`` * Flash = (3,8) * Thor = (3, 6) * **Input for turn 1**: ``10`` * _Thor has enough energy left for 10 moves_ * **Output for turn 1**: ``S`` * _Thor moves Southwards._ * **New position** = _(3, 7)_ * **Input for turn 2**: ``9`` * _Thor has enough energy left for 9 moves_ * **Output for turn 2**: ``S`` * _Thor moves Southwards._ * **New position** = _(3, 6)_ * **Thor has won**: he has reached the flash of power!