If one root of x2+px−10=0 is 2 while the equation x2−px+q=0 has equal roots, then the value of q is