def same_numbers(ary, result = [])
  return result.sort if ary.empty?
  a = ary.first
  co = ary.count(a)
  result << co if co > 1
  same_numbers(ary - [a], result)
end

$<.readlines.map {|l| l.split(",").map(&:to_i)}.each do |hand|
  puts case same_numbers(hand)
       when [4]    then "four card"
       when [2, 3] then "full house"
       when [3]    then "three card"
       when [2, 2] then "two pair"
       when [2]    then "one pair"
       else
         hand.sort!
         if hand.sum == (hand.first + 2) * 5 or hand == [1, 10, 11, 12, 13]
           "straight"
         else
           "null"
         end
       end
end
