Chef is currently facing the north direction. Each second he rotates exactly 90 degrees in clockwise direction. Find the direction in which Chef is facing after exactly X seconds.

\textbf{Note}: There are only 4 directions: North, East, South, West (in clockwise order).

------ Input Format ------ 

- First line will contain T, number of testcases. Then the testcases follow.
- Each testcase contains of a single integer X.

------ Output Format ------ 

For each testcase, output the direction in which Chef is facing after exactly X seconds.

------ Constraints ------ 

$1 ≤ T ≤ 100$
$1 ≤ X ≤ 1000$

----- Sample Input 1 ------ 
3
1
3
6

----- Sample Output 1 ------ 
East
West
South

----- explanation 1 ------ 
Chef is facing North in the starting.

Test Case $1$: After $1$ second he turns $90$ degrees clockwise and now faces the east direction.

Test Case $2$:
Direction after $1$ second- east

Direction after $2$ seconds- south

Direction after $3$ seconds- west

Source: codechef | Difficulty: EASY
Tags: Mathematics

Implementation

Complete search


Solutions:
t = int(input())
for i in range(t):
	x = int(input())
	if x % 4 == 0:
		print('North')
	elif x % 4 == 1:
		print('East')
	elif x % 4 == 2:
		print('South')
	elif x % 4 == 3:
		print('West')


for i in range(int(input())):
	X = int(input())
	if X % 4 == 1:
		print('East')
	elif X % 4 == 2:
		print('South')
	elif X % 4 == 3:
		print('West')
	else:
		print('North')


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 4 == 1:
		print('East')
	elif n % 4 == 2:
		print('South')
	elif n % 4 == 3:
		print('West')
	else:
		print('North')


n = int(input())
for api in range(n):
	data = int(input())
	new_data = data % 4
	if new_data == 1:
		print('East')
	elif new_data == 2:
		print('South')
	elif new_data == 3:
		print('West')
	elif new_data == 0:
		print('North')


repeat = int(input())
for item in range(repeat):
	second = int(input())
	if 1 <= second <= 100:
		convert = second % 4
		if convert == 1:
			print('East')
		if convert == 2:
			print('South')
		if convert == 3:
			print('West')
		if convert == 0:
			print('North')


n = int(input())
for i in range(n):
	length = int(input())
	if length % 4 == 0:
		print('North')
	elif length % 4 == 1:
		print('East')
	elif length % 4 == 2:
		print('South')
	else:
		print('West')


lst = ['North', 'East', 'South', 'West']
t = int(input())
for i in range(t):
	x = int(input())
	print(lst[x % 4])


for t in range(int(input())):
	X = int(input())
	if X % 4 == 0:
		print('North')
	elif X % 4 == 1:
		print('East')
	elif X % 4 == 2:
		print('South')
	elif X % 4 == 3:
		print('West')
	else:
		continue


t1 = int(input())
for i in range(t1):
	t = int(input())
	if t % 4 == 0:
		print('North')
	elif t % 4 == 1:
		print('East')
	elif t % 4 == 2:
		print('South')
	else:
		print('West')


T = int(input())
for _ in range(T):
	X = int(input())
	result_mod = X % 4
	if result_mod == 0:
		print('North')
	elif result_mod == 1:
		print('East')
	elif result_mod == 2:
		print('South')
	elif result_mod == 3:
		print('West')


t = int(input())
while t:
	t -= 1
	x = int(input())
	if x % 4 == 1:
		print('East')
	elif x % 4 == 2:
		print('South')
	elif x % 4 == 3:
		print('West')
	else:
		print('North')


def code():
	cases = int(input())
	for _ in range(cases):
		X = int(input())
		directions = ['North', 'East', 'South', 'West']
		indx = 0
		for sec in range(X):
			if indx < len(directions) - 1:
				indx += 1
			elif indx == len(directions) - 1:
				indx = 0
		print(directions[indx])
code()


t = int(input())
for i in range(t):
	x = int(input())
	lis = ['North', 'East', 'South', 'West']
	ans = x % 4
	print(lis[ans])


T = int(input())
for _ in range(T):
	X = int(input())
	d = {0: 'North', 1: 'East', 2: 'South', 3: 'West'}
	print(d[X % 4])


for i in range(int(input())):
	x = int(input())
	list = ['East', 'South', 'West', 'North']
	if x <= 4:
		print(list[x - 1])
	elif x > 4:
		print(list[x % 4 - 1])


li = ['North', 'East', 'South', 'West ']
for _ in range(int(input())):
	t = int(input())
	for (index, elem) in enumerate(li, t - t % 4):
		if index == t:
			print(elem)


t = int(input())
for e in range(t):
	x = int(input())
	x *= 90
	y = x % 360
	if y % 360 == 0 or x == 0:
		print('North')
	elif y % 360 == 270:
		print('West')
	elif y % 360 == 180:
		print('South')
	elif y % 360 == 90:
		print('East')


t = int(input())
while t > 0:
	i = int(input())
	if i % 2 != 0:
		if i in range(1, 1000, 4):
			print('East')
		elif i in range(3, 1000, 4):
			print('West')
	elif i in range(0, 1000, 4):
		print('North')
	elif i in range(2, 1000, 4):
		print('South')
	t = t - 1


for i in range(0, int(input())):
	x = int(input())
	a = x % 4
	if a == 0:
		print('North')
	elif a == 1:
		print('East')
	elif a == 2:
		print('South')
	else:
		print('West')


for i in range(int(input())):
	X = int(input())
	temp = ['North', 'East', 'South', 'West']
	count = 0
	while X > 0:
		count += 1
		if count >= 4:
			count = 0
		X -= 1
	print(temp[count])


for i in range(int(input())):
	X = int(input())
	r = ['North', 'East', 'South', 'West']
	while X >= 4:
		X -= 4
	print(r[X])


for _ in range(int(input())):
	prev = 'north'
	n = int(input())
	for i in range(n):
		if prev == 'north':
			prev = 'east'
		elif prev == 'east':
			prev = 'south'
		elif prev == 'south':
			prev = 'west'
		elif prev == 'west':
			prev = 'north'
	print(prev.capitalize())


for _ in range(int(input())):
	x = int(input())
	m = x % 4
	if m == 0:
		print('North')
	elif m == 1:
		print('East')
	elif m == 2:
		print('South')
	else:
		print('West')