import collections ls = list(map(int,input().split())) cnt = list(collections.Counter(ls).values()) cnt.sort() if2 = 0 if3 = 0 for i in cnt: if i == 2: if2 += 1 elif i == 3: if3 += 1 if if3 == 1 and if2 == 1: print('FULL HOUSE') elif if2 == 2: print('TWO PAIR') elif if3 == 1: print('THREE CARD') elif if2 == 1: print('ONE PAIR') else: print('NO HAND')