# -*- coding:utf-8 -*- from collections import Counter if __name__ == "__main__": hand = map(int,raw_input().split()) count = Counter(hand) hand_count = count.values() hand_count.sort() hand_count = hand_count[::-1] if hand_count[0] >= 4: print "NO HAND" elif hand_count[0] == 3: if hand_count[1] == 1: print "THREE CARD" else: print "FULL HOUSE" elif hand_count[0] == 2: if hand_count[1] == 2: print "TWO PAIR" else: print "ONE PAIR" else: print "NO HAND"