-- [Char]あるいは String を Int にする toInt :: (String -> Int) toInt x = read x :: Int -- 入力を受け取り、[Int]にする getInts = do x <- getLine let y = map toInt $ words x return y countElement x = length . filter (x ==) enumerate hands = [countElement x hands | x <- [1 .. 13]] judge hands | 3 `elem` hands = if 2 `elem` hands then "FULL HOUSE" else "THREE CARD" | 2 `elem` hands = if countElement 2 hands == 2 then "TWO PAIR" else "ONE PAIR" | otherwise = "NO HAND" main = do x <- getInts let res = (judge . enumerate) x putStrLn res