Max's Anger Contest Series 2 P1 - Directed Anger

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

After Max successfully completed his useless List II Communication credit last term, he lost his sense of direction.

He only remembers the direction he was facing originally, D; how many times he turned 90 degrees left, L; and how many times he turned 90 degrees right, R.

Can you tell Max what direction he is facing after all of those turns?

Constraints

D is one of the four cardinal directions: N, S, E, or W.

0 \le L, R \le 100.

Input Specification

The first line will contain D, the direction he was facing.

The second line will contain L, the number of times he turned 90 degrees left.

The third line will contain R, the number of times he turned 90 degrees right.

Output Specification

Output the direction after all the turns have been completed.

Sample Input 1

S
2
1

Sample Output 1

E

Sample Input 2

N
5
0

Sample Output 2

W

Comments

There are no comments at the moment.