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