s=input() text="X" count=0 for c in s: if c==text: count+=1 else: text=c count=1 if count==3: if text=="X": print("WEST") else: print("EAST") exit(0) print("NA")