from itertools import groupby S = input() for k, v in groupby(S): if len(tuple(v)) == 3: print("East" if k == "O" else "West") quit() print("NA")