def main(): a, b, c, d, e = (int(x) for x in input().split( )) l = [a, b, c, d, e] l.sort() n_dic = {} for y in l: n_dic[y] = l.count(y) hand = list(n_dic.values()) hand.sort() print(hand) if hand == [2,3]: print("FULL HOUSE") if hand == [1,1,3]: print('THREE CARD') if hand == [1,2,2]: print('TWO PAIR') if hand == [1,1,1,2]: print('ONE PAIR') if __name__ == "__main__": main()