f=input().find e=f('OOO') w=f('XXX') print(['EWaesstt'[e<0 or e>w::2],'NA'][e==w])