s = input() if 'ooo' in s: print('East') elif 'xxx' in s: print('West') else: print('NA')