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