S = input() ans = -1 for i in range(len(S)-2): if S[i] == S[i+1] and S[i+1] == S[i+2]: ans = S[i] break if ans == -1: print('NA') elif ans == 'O': print('East') else: print('West')