def full_house(cnt): return cnt[0] == 3 and cnt[1] == 2 def three_card(cnt): return cnt[0] == 3 def two_pair(cnt): return cnt[0] == 2 and cnt[1] == 2 def one_pair(cnt): return cnt[0] == 2 def main(): a = (int(x) for x in input().split()) cnt = [0] * 13 for e in a: cnt[e-1] += 1 cnt.sort(reverse=True) if full_house(cnt): print("FULL HOUSE") elif three_card(cnt): print("THREE CARD") elif two_pair(cnt): print("TWO PAIR") elif one_pair(cnt): print("ONE PAIR") else: print("NO HAND") if __name__ == '__main__': main()