a = list(map(int, input().split())) ans = list() for i in range(1, 14): if i in a: ans.append(a.count(i)) ans.sort() if ans == [1, 1, 1, 2]: print('ONE PAIR') elif ans == [1, 2, 2]: print('TWO PAIR') elif ans == [1, 1, 3]: print('THREE CARD') elif ans == [2, 3]: print('FULL HOUSE') else: print('NO HAND')