a=list(map(int, input().split()));x,y=0,0 ans = [['NO HAND','ONE PAIR','TWO PAIR'],['THREE CARD','FULL HOUSE']] for i in a: if a.count(i) == 3: x+=1 a = [_ for _ in a if _!=i] elif a.count(i) == 2: y+=1 a = [_ for _ in a if _!=i] print(ans[x][y])