s=input() p=s[0]=="O" w=1 for i in range(1,len(s)): if s[i]==s[i-1]: w+=1 else: p^=1 w=1 if w==3: print(["West","East"][p]) exit() print("NA")