from collections import Counter def main(): a = input().split() c = dict(Counter(a)) count_list = list(c.values()) three = count_list.count(3) two = count_list.count(2) 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()