L = sorted(list(map(int, input().split()))) M = set(L) if len(M) == 2: if L.count(L[0]) == 3 or L.count(L[2]) == 3: print('FULL HOUSE') else: print('NO HAND') elif len(M) == 3: if L.count(L[0]) == 3 or L.count(L[2]) == 3: print("THREE CARD") else: print('TWO PAIR') elif len(M) == 4: print('ONE PAIR') else: print('NO HAND')