S = input() ans = "NA" for i in range(2,len(S)) : if S[i-2] == S[i-1] == S[i] : if S[i] == "o" : ans = "East" else : ans = "West" break print(ans)