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