#!/usr/bin/python # -*- coding: utf-8 -*- arys = map(int, raw_input().split()) if len(set(arys)) == 2 and 2 <= arys.count(max(set(arys))) <= 3: print "FULL HOUSE" elif len(set(arys)) == 3 and ( arys.count(arys[0]) == 3 or arys.count(arys[1]) == 3 or arys.count(arys[2]) == 3 ): print "THREE CARD" elif len(set(arys)) == 3 and ( arys.count(arys[0]) == 2 or arys.count(arys[1]) == 2 ): print "TWO PAIR" elif len(set(arys)) == 4: print "ONE PAIR" else: print "NO HAND"