import Data.List
import Data.List.Split

main = interact $ unlines.map (handCheck.map read.splitOn ",").lines
handCheck cards
    | isFourCard cards = "four card"
    | isFullHouse cards = "full house"
    | isStraight cards  = "straight"
    | isThreeCard cards = "three card"
    | isTwoPair cards   = "two pair"
    | isOnePair cards   = "one pair"
    | otherwise         = "null"

isFourCard cds = 4 == (maximum.map length.group.sort $ cds)
isFullHouse cds = 2 == (length.group.sort $ cds)
isStraight cds = case mincds of
                   1 -> [mincds..mincds+4] == scds || (tail scds) == [10..13]
                   otherwise -> [mincds..mincds+4] == scds
                   where scds = sort cds
                         mincds = head scds
isThreeCard cds = 3 == (maximum.map length.group.sort $ cds)
isTwoPair cds = 3 == (length.group.sort $ cds)
isOnePair cds = 2 == (maximum.map length.group.sort $ cds)