card = list(map(int, input().split())) count = [] for i in card: count.append(card.count(i)) if count.count(3) == 3 and count.count(2) == 2: print('FULL HOUSE') elif count.count(3) == 3 and count.count(1) == 2: print('THREE CARD') elif count.count(2) == 4: print('TWO PAIR') elif count.count(2) == 2: print('ONE PAIR') else: print('NO HAND')