405923: GYM102157 4 North East South West

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

4. North East South Westtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Ahmad is playing a game with his friend. The game works like this. Ahmad will start by facing north, then he close his eye. When his friend say "right" he will rotate clockwise by 90 degree. So if he was facing north, he will now face east. If he was facing east, he will now face south. If his friend says "left", he will rotate counter-clockwise by 90 degree. So if he is facing north, he will now face west. If he was facing west, he will now face south. When his friend say "back" he can either rotate clockwise or counter-clockwise by 180 degree. So if he was facing north, he will now face south. If he was facing west, he will now face east.

After several command, Ahmad will now guess which direction he is facing. Help Ahmad figure-out which direction he is facing now.

Input

Input starts with a number $$$n, (1 \le n \le 10^5)$$$. The next $$$n$$$ lines each consist of a single word which is either, "left", "right" or "back".

Output

Output a single word, which can be either "north", "east", "south", "west".

ExampleInput
4
left
left
left
right
Output
south

加入题单

上一题 下一题 算法标签: