If polynomial p(x)=x2−5x+7 is divided by g(𝑥), the q(𝑥) and r(𝑥) are 𝑥 - 3 and 1, respectively. Find g(𝑥).