decks=input().split() deck=list(map(lambda x:int(x),decks)) if deck[0]==deck[1]==deck[2]==deck[3] or deck[1]==deck[2]==deck[3]==deck[4]: print("FOUR CARD") elif(deck[0]==deck[1]and deck[2]==deck[3]==deck[4])or(deck[0]==deck[1]==deck[2]and deck[3]==deck[4]): print("FULL HOUSE") elif (deck[0]==deck[1]==deck[2])or(deck[1]==deck[2]==deck[3])or(deck[2]==deck[3]==deck[4]): print("THREE CARD") elif (deck[0]==deck[1]and deck[2]==deck[3])or(deck[1]==deck[2] and deck[3]==deck[4]): print("TWO PAIR") elif deck[0]==deck[1] or deck[1]==deck[2]or deck[2]==deck[3]or deck[3]==deck[4]: print("ONE PAIR") else: print("NO CARD") print(deck)