A = list(map(int,input().split())) dic = {} for i in range(5): if A[i] in dic: dic[A[i]] += 1 else: dic[A[i]] = 1 four = 0 three = 0 two = 0 for value in dic.values(): if value == 4: four += 1 elif value == 3: three += 1 elif value == 2: two += 1 if four == 1: print('FOUR CARD') if three == 1 and two == 1: print('FULL HOUSE') elif three == 1: print('THREE CARD') elif two == 2: print('TWO PAIR') elif two == 1: print('ONE PAIR') else: print('NO HAND')