I am trying to make a program that determines if something is the clockwise direction or counterclockwise direction based on string input that only contains north south east west (n s e w) for example, if I had the string "NESSWN" I know it is clockwise because of drawing it out but I can't figure out a definitive solution applicable to every case for it no matter how hard I think. Below is all the code I've tried so far.
n=int(input())
for i in range(n):
path=input()
finds=path.find("S")
findn=path.find("N")
findw=path.find("W")
finde=path.find("E")
rfindw=path.rfind("W")
rfinde=path.rfind("E")
if finde<findw and rfindw>rfinde:
print("CCW")
if finde<findw and rfinde>rfindw:
print("CW")
if findw<finde and rfinde>rfindw:
print("CW")
if findw<finde and rfindw>rfinde:
print("CCW")