PUMaC 2022 Number Theory A Problem 1

Find the sum of all prime numbers p such that p divides
(p^2 + p + 20)^{p^2+p+2} + 4(p^2 + p + 22)^{p^2-p+4}.