s=gets a=s.index("XXX") b=s.index("OOO") a=10**9 if !a b=10**9 if !b puts ab ? :East : :NA