all_number = input().split() number = [] for i in all_number: number.append(i) number.sort() if number[0] == number[1] == number[2] and number[3] == number[4] or number[0] == number[1] and number[2] == number[3] == number[4]: print('FULL HOUSE') elif number[0] == number[1] == number[2] and number[3] != number[4] or number[1] == number[2] == number[3] and number[0] != number[4] or number[2] == number[3] == number[4] and number[0] != number[1]: print('THREE CARD') elif number[0] == number[1] == number[2] == number[3] == number[4] or number[0] != number[1] != number[2] != number[3] != number[4]: print('NO HAND') elif number[0] == number[1] and number[2] == number[3] or number[0] == number[1] and number[3] == number[4] or number[1] == number[2] and number[3] == number[4]: print('TWO PAIR') else: print('ONE PAIR')