f = input() s_f = f.split() #int_f = [int(v) for v in s_f] #int_f.sort() s_f.sort() set_f = set(s_f) if len(set_f) == 2: if s_f[1] != s_f[2] or s_f[2] != s_f[3]: print('FULL HOUSE') else: print('NO PAIR') elif len(set_f) == 3: if s_f[0] == s_f[2] or s_f[1] == s_f[3] or s_f[2] == s_f[4]: print('THREE CARD') else: print('TWO PAIR') elif len(set_f) == 4: print('ONE PAIR') else: print('NO PAIR')