A = map(int, input().split()) L = sorted([A.count(i) for i in set(A)]) if L == [2, 3]: print('FULL HOUSE') elif 3 in L: print('THREE CARD') elif L == [1, 2, 2]: print('TWO PAIR') elif 2 in L: print('ONE PAIR') else: print('NO HAND')