s = str(input()) n = len(s) cnt = 0 cur = '' for i in range(n): if s[i] != cur: cnt = 1 cur = s[i] else: cnt += 1 if cnt == 3: if cur == 'O': print('East') else: print('West') exit() else: print('NA')