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