s = list(map(int, input().split())) A = list(set(s)) ans = [] for a in A: b = s.count(a) ans.append(b) if len(ans) == 5: print('NO HAND') elif len(ans) == 4 and 2 in ans: print('ONE PAIR') elif len(ans) == 3 and 2 in ans: print('TWO PAIR') elif len(ans) == 3 and 3 in ans: print('THREE CARD') elif len(ans) == 2 and 3 in ans and 2 in ans: print('FULL HOUSE') else: print('NO HAND')