def main(): A = list(map(int, input().split())) A.sort() count = [] for x in range(5): count.append(A.count(A[x])) if 2 in count: if 3 in count: print('FULL HOUSE') elif count.count(2) == 4: print('TWO PAIR') else: print('ONE PAIR') elif 3 in count: print('THREE CARD') else: print('NO HAND') if __name__ == '__main__': main()