s=gets a=s.index 'XXX' b=s.index 'OOO' if !a and !b puts :NA elsif a and b puts a