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 3 in cd and 2 in cd: print("FULL HOUSE") elif 3 in cd : print("THREE CARD") elif cd[0] == cd[1]: print("TWO PAIR") elif cd[0] == 2 : print("ONE PAIR") else: print("NO HAND")