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