import collections from typing import Counter def main(): a, b, c, d, e = (int(x) for x in input().split()) l = [a, b, c, d, e] counter = collections.Counter(l) if len(counter) == 1: print('NO HAND') exit() k = counter.most_common()[0][1] m = counter.most_common()[1][1] s = len(counter) if k == 3 and m == 2: print('FULL HOUSE') elif k == 3 and m == 1 and s == 3: print('THREE CARD') elif k == 2 and m == 2 and s == 3: print('TWO PAIR') elif k == 2 and m == 1 and s == 4: print('ONE PAIR') else: print('NO HAND') if __name__ == '__main__': main()