let hand a =
    let t = (a.(0),a.(1),a.(2),a.(3),a.(4)) in
    match t with
    (i,j,k,l,m) when (j,k,l) = (i,i,i) || (k,l,m) = (j,j,j) -> "four card"
    | (i,j,k,l,m) when (j,l,m) = (i,k,k) || (j,k,m) = (i,i,l) -> "full house"
    | (i,j,k,l,m) when (j,k) = (i,i) || (k,l) = (j,j) || (l,m) = (k,k) -> "three card"
    | (i,j,k,l,m) when (j,l) = (i,k) || (j,m) = (i,l) || (k,m) = (j,l) -> "two pair"
    | (i,j,k,l,m) when j = i || k = j || l = k || m = l -> "one pair"
    | (i,j,k,l,m) when (i,j,k,l,m) = (i,(i+1),(i+2),(i+3),(i+4))
                     || (i,j,k,l,m) = (1,10,11,12,13) -> "straight"
    | _ -> "null"
;;

let () =
    let rec read () =
        try let line = Scanf.scanf " %d,%d,%d,%d,%d\n" (fun v w x y z -> [|v;w;x;y;z|]) in
        Array.sort compare line;
        hand line |> print_endline;
        read ()
        with End_of_file -> ()
    in read ()
;;