let ``No.24 数当てゲーム`` () = let N = int <| stdin.ReadLine() let s = set [0..9] let rec f n s = if n <= 0 then s |> Seq.item 0 else let arr = stdin.ReadLine().Split(' ') let s2 = arr.[0..3] |> Array.map int |> Set.ofArray f (n-1) ((if arr.[4] = "YES" then Set.intersect else Set.difference) s s2) f N <| set [0..9] |> printfn "%d" ``No.24 数当てゲーム`` ()