def mainProc(lst) : two, three = 0, 0 for i in range(1,14): if (lst.count(i) == 2) : two += 1 if (lst.count(i) == 3) : three += 1 if three == 1 and two == 1 : print('FULL HOUSE') elif three == 1 and two == 0 : print('THREE CARD') elif three == 0 and two == 2 : print('TWO PAIR') elif three == 0 and two == 1 : print('ONE PAIR') else : print('NO HAND') if __name__ == '__main__' : lst = [int(i) for i in input().split()] mainProc(lst)