def main(): X = {} for i in input().split(): X[i] = X.get(i, 0) + 1 Z = {} Z[0] = Z[1] = Z[2] = Z[3] = Z[4] = Z[5] = 0 for x, i in X.items(): Z[i] = Z[i] + 1 if Z[3] == 1 and Z[2] == 1: print('FULL HOUSE') elif Z[3] == 1: print('THREE CARD') elif Z[2] == 2: print('TWO PAIR') elif Z[2] == 1: print('ONE PAIR') else: print('NO HAND') if __name__ == '__main__': main()