class Poker
  def initialize
    @card_list = ["1","2","3","4","5","6","7",
              "8","9","10","11","12","13"]
    @results = []
    input
    @results.each do |ans|
      puts ans
    end
  end

  def input
    while input = $stdin.gets
      @results << checker(create_hand(input))
    end
  end

  def create_hand(input)
    input.chomp.split(',')
  end

  def checker(hands)
    @card_list.each_with_index do |elem,index|
      case hands.count(elem)   
      when 2
        hands.delete(elem)
        return two_check(hands)
      when 3
        hands.delete(elem)
        return three_check(hands)
      when 4
        return "four card"
      else
      end
    end 
    return straight_check(hands)
  end

  def two_check(hands)
    hands.each do |elem|
      case hands.count(elem)
      when 2
        return "two pair"
      when 3
        return "full house"
      end
    end
    return "one pair"
  end

  def three_check(hands)
    hands.each do |elem|
      case hands.count(elem)
      when 2
        return "full house"
      else
        return "three card"
      end
    end
  end

  def straight_check(hands)
    count = 0
    (@card_list+["1"]).each do |elem|
      if hands.include?(elem)
        count += 1
        return "straight" if count == 5
      else
        count = 0
      end
    end
    return "null"
  end
end

p = Poker.new