The quadratic equation x^2-6=12 is rewritten in the formula (x+p)^2=q where a is a constant. What is the value of p