import sequtils,strutils,algorithm var A = stdin.readline.split.map(parseInt) cntP, cntT, cntQ : int A.sort(cmp) if A[0] == A[3] or A[1] == A[4]: cntQ += 1 for i in 0..3: if i < 3 and A[i] == A[i + 2]: cntT += 1 cntP -= 1 elif A[i] == A[i + 1]: cntP += 1 if cntQ == 1: echo "NO HAND" elif cntT == 1 and cntP == 1: echo "FULL HOUSE" elif cntT == 1: echo "THREE CARD" elif cntP == 2: echo "TWO PAIR" elif cntP == 1: echo "ONE PAIR" else: echo "NO HAND"