#!/usr/bin/env python incards = [] incards = input().strip() doub = 0 trip = 0 for i in set(incards): if incards.count(i) == 3: trip += 1 elif incards.count(i) == 2: doub += 1 if trip == 1: if doub == 1: print('FULL HOUSE') else: print('THREE CARD') elif doub == 2: print('TWO PAIR') elif doub == 1: print('ONE PAIR') else: print('NO HAND')