def main(): d = list(map(int,input().split())) kosu = [0] * 13 for i in range(0,5): kosu[d[i]]=kosu[d[i]]+1 kosuk = sorted(kosu,reverse=True) if kosuk[0] == 3: if kosuk[1] == 2: print('FULL HOUSE') else: print('THREE CARD') elif kosuk[0] == 2: if kosuk[1] == 2: print('TWO PAIR') else: print('ONE PAIR') else: print('NO HAND') if __name__ == '__main__': main()