s=input() e,w=s.find('OOO'),s.find('XXX') print([['East','West'][e<0 or-1