while 1:print(~"TST".find(input()[-2:])%11or"PHONY")