package main import ( "fmt" "strings" ) func main() { var s string fmt.Scan(&s) e := strings.Index(s, "OOO") w := strings.Index(s, "XXX") // fmt.Println("e", e, "w", w) if e >= 0 && w >= 0 { if w > e { fmt.Println("East") } else { fmt.Println("West") } } else if e < 0 && w < 0 { fmt.Println("NA") } else { if e >= 0 { fmt.Println("East") } else { fmt.Println("West") } } }