a = list(map(int,input().split())) a.sort() sta = a[0] i = 1 pairs = 0 three = 0 count = 1 while i<5: if sta == a[i]: count += 1 else: sta = a[i] if count == 2: pairs += 1 elif count == 3: three += 1 count = 1 i += 1 if count == 2: pairs += 1 elif count == 3: three += 1 if pairs == 1 and three == 1: print("FULL HOUSE") elif three == 1: print("THREE CARD") elif pairs == 2: print("TWO PAIR") elif pairs == 1: print("ONE PAIR") else: print("NO HAND")