A=[] first = raw_input() for i in range(0,5): split_first = first.split() A.append(int(split_first[i])) LL = list(set(A)) if len(set(A)) == 2: if A.count(LL[0]) == 2 or A.count(LL[0]) == 3: print 'FULL HOUSE' else: print 'NO HAND' elif A.count(A[0]) == 3 or A.count(A[1]) == 3 or A.count(A[2]) ==3 or A.count(A[3]) == 3 or A.count(A[4]) == 3: print 'THREE CARD' elif len(set(A)) == 3: if A.count(L[0]) <= 2 or A.count(L[1]) <= 2 or A.count(L[2]) <= 2: print 'TWO PAIR' elif len(set(A)) == 4: print 'ONE PAIR' else: print 'NO HAND'