s=gets i=s.index 'ooo' j=s.index 'xxx' puts i ? (j ? (i < j ? :East : :West) : :East) : (j ? :West : :NA)