A = list(map(int, input().split())) p = {} two = 0 thr = 0 for i in A: if i not in p: p[i] = 1 else: p[i] += 1 if p[i] == 2: two += 1 elif p[i] == 3: thr += 1 two -= 1 elif p[i] == 4: thr -= 1 if two == 1 and thr == 0: print('ONE PAIR') elif two == 2: print('TWO PAIR') elif two == 0 and thr == 1: print('THREE CARD') elif two == 1 and thr == 1: print('FULL HOUSE') else: print('NO PAIR')