import Data.List main=interact(\s->if f"OOO"s then"East"else if f"XXX"s then"West"else"NA")where x`f`s=x`isInfixOf`s