cs = map(int,input().split()) cd = {} for c in cs: if c in cd: cd[c] += 1 else: cd[c] = 1 cd = list(cd.values()) cd.sort(reverse=True) if len(cd) == 5: print("NO PAIR") elif cd[0] == cd[1]: print("TWO PAIR") elif cd[0] == 2 : print("ONE PAIR") elif 3 in cd and 2 in cd: print("FULL HOUSE") else: print("THREE CARD")