import collections a = list(map(int,input().split())) v = sorted(collections.Counter(a).values()) if v == [2,3]: print('FULL HOUSE') elif v == [1,1,3]: print('THREE CARD') elif v == [1,2,2]: print('TWO PAIR') elif v == [1,1,1,2]: print('ONE PAIR') else: print('NO HAND')