#!/usr/bin/python3 # This problem is http://yukicoder.me/problems/562 first_line = input() # first_line = '5 6 5 6 5' no_duplication = set(first_line.split(' ')) answer = [] for char in no_duplication: answer.append(len(first_line.split(char)) - 1) answer = sorted(answer) if answer == [2, 3]: print('FULL HOUSE') elif answer == [1, 1, 3]: print('THREE CARD') elif answer == [1, 2, 2]: print('TWO PAIR') elif answer == [1, 1, 1, 2]: print('ONE PAIR') else: print('NO HAND') # print(answer)