s=input() e=0;w=0 for c in s: if c=='O': e+=1 w=0 if e==3: print('East') exit(0) else: e=0 w+=1 if w==3: print('West') exit(0) print('NA')