s=input();a,b='',0 for i in s: if a!=i: a=i else: b+=1 if b==3: print('East' if i=='O' else 'West');exit() print('NA')