package main import "fmt" func main() { var ok [10]bool for i := 0; i < len(ok); i++ { ok[i] = true } var a [4]int var N int fmt.Scan(&N) for i := 0; i < N; i++ { for j := 0; j < 4; j++ { fmt.Scan(&a[j]) } var ans string fmt.Scan(&ans) if ans == "NO" { for j := 0; j < 4; j++ { ok[a[j]] = false } } else { for j := 0; j < 10; j++ { ng := true for k := 0; k < len(a); k++ { if a[k] == j { ng = false } } if ng { ok[j] = false } } } } for i := 0; i < len(ok); i++ { if ok[i] { fmt.Println(i) return } } }