from collections import Counter def main(): a = input().split() c = dict(Counter(a)) print(c.values()) count_list = list(c.values()) three = count_list.count(3) two = count_list.count(2) # print(three) # print(two) if three == 1 and two == 1: print("FULL HOUSE") elif three == 1: print("THREE CARD") elif two == 2: print("TWO PAIR") elif two == 1: print("ONE PAIR") else: print("NO HAND") if __name__ == '__main__': main()