# No.227 簡単ポーカー cards = [int(i) for i in input().split()] numbers = [0] * 14 for i in range(5): numbers[cards[i]] += 1 if numbers.count(3) == 1 and numbers.count(2) == 1: print('FULL HOUSE') elif numbers.count(3) == 1: print('THREE CARD') elif numbers.count(2) == 2: print('TWO PAIR') elif numbers.count(2) == 1: print('ONE PAIR') else: print('NO HAND')