def main(): """ 5 6 5 6 9 """ cards = list(map(int, input().split(' '))) card_set = set(cards) # {5, 6}, {5, 6, 9} num_counts = len(card_set) # 2, 3 target_numbers = [cards.count(card) for card in card_set] # [3, 2] [3, 1, 1], [2, 2, 1] if (num_counts == 2) and (2 or 3 in target_numbers): print('FULL HOUSE') elif (num_counts == 3) and (3 in target_numbers): print('THREE CARD') elif (num_counts == 3) and (2 in target_numbers): print("TWO PAIR") elif num_counts == 4: print("ONE PAIR") else: print("NO HAND") if __name__ == "__main__": main()