s=input() e,w,l=s.find('OOO'),s.find('XXX'),len(s) if e<0:e=l if w<0:w=l print([['West','East'][e