a = list(map(int, input().split())) cnt = [0 for _ in range(14)] for ai in a: cnt[ai] += 1 if 3 in cnt and 2 in cnt: print('FULL HOUSE') elif 3 in cnt: print('THREE CARD') elif cnt.count(2) == 2: print('TWO PAIR') elif 2 in cnt: print('ONE PAIR') else: print('NO HAND')