a=input();l=a.find('OOO');r=a.find('XXX') if l==r:print("NA") else:print(["Ea","We"][l==-1or(r!=-1and l>r)]+"st")