def four_card?(cards)
  cards[0] == cards[3] || cards[1] == cards[4]
end

def full_house?(cards)
  (cards[0] == cards[1] && cards[2] == cards[4]) ||
  (cards[0] == cards[2] && cards[3] == cards[4])
end

def straight?(cards)
  cards[0] != cards[1] && cards[1] != cards[2] && cards[2] != cards[3] &&
  cards[3] != cards[4] &&
  (cards[4] - cards[0] == 4 || cards[0] == 1 && cards[1] == 10)
end

def three_card?(cards)
  cards[0] == cards[2] || cards[1] == cards[3] || cards[2] == cards[4]
end

def two_pair?(cards)
  (cards[0] == cards[1] && (cards[2] == cards[3] || cards[3] == cards[4])) ||
  (cards[1] == cards[2] && cards[3] == cards[4])
end

def one_pair?(cards)
  (cards[0] == cards[1]) || (cards[1] == cards[2]) ||
  (cards[2] == cards[3]) || (cards[3] == cards[4])
end

def hand(cards)
  return 'four card'  if four_card?(cards)
  return 'full house' if full_house?(cards)
  return 'straight'   if straight?(cards)
  return 'three card' if three_card?(cards)
  return 'two pair'   if two_pair?(cards)
  return 'one pair'   if one_pair?(cards)
  return 'null'
end

gets(nil).split.each do |line|
  cards = line.split(',').map(&:to_i).sort
  puts hand(cards)
end