Temperature Generation Script with p=9