while 1:print({"STS":10,"ST":9}.get(input()[4:],"PHONY"))