package main import "fmt" func main() { ok := [10]bool{} for i, _ := range ok { ok[i] = true } var n int fmt.Scan(&n) for i := 0; i < n; i++ { var a, b, c, d int var r string fmt.Scan(&a, &b, &c, &d, &r) if r == "YES" { for j := 0; j < 10; j++ { if j != a && j != b && j != c && j != d { ok[j] = false } } } else { for _, e := range [4]int{a, b, c, d} { ok[e] = false } } } for i, e := range ok { if e { fmt.Println(i) } } }