(define (shori-hantei xs) (let ((east (string-scan xs "OOO")) (west (string-scan xs "XXX"))) (cond ((and (not east) (not west)) "NA") ((not east) "West") ((not west) "East") ((< east west) "East") (else "West")))) (print (shori-hantei (read-line)))