from collections import Counter a = list(map(int,input().split())) ans = 0 c = Counter(a) for i in range(1,14): for j in range(1,14): if i == j:continue if (c[i] == 3 and c[j] == 2) or (c[i] == 2 and c[j] == 3): ans = 4 if c[i] == 3 or c[j] == 3: ans = max(ans, 3) if c[i] == 2 and c[j] == 2: ans = max(ans , 2) if c[i] == 2 or c[j] == 2: ans = max(ans , 1) op = ['NO HAND', 'ONE PAIR', 'TWO PAIR', 'THREE CARD', 'FULL HOUSE'] print(op[ans])