a=gets.split.map(&:to_i) u=a.uniq.sort{|x,y|a.count(x)<=>a.count(y)} res=[nil,"NO HAND",a.count(u.last)==3 ? "FULL HOUSE" : "NO HAND",a.count(u.last)==3 ? "THREE CARD" : "TWO PAIR","ONE PAIR","NO HAND"] puts res[u.size]