def main(): S = list(input()) east = 0 west = 0 for s in S: if s == "O": east += 1 if east == 3: print("East") return else: west += 1 if west == 3: print("West") return print("NA") if __name__ == "__main__": # {{{ try: import test test.test() except: main() # }}}