import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from collections import Counter counter = sorted(Counter(read().split()).values(), reverse=True) def solve(counter): if counter == [3,2]: return 'FULL HOUSE' if counter == [3,1,1]: return 'THREE CARD' if counter == [2,2,1]: return 'TWO PAIR' if counter == [2,1,1,1]: return 'ONE PAIR' return 'NO HAND' answer = solve(counter) print(answer)