According to the answer sheet it is supposed to reduce to $p$, but I dont know how. This is what I do

$$(\lambda x. (\lambda y. x \ y) \ x) \ (\lambda z.p)$$

I replace $x$ with $(\lambda z.p)$

$$\rightarrow (\lambda y. (\lambda z.p) \ y) \ (\lambda z.p))$$

And now $y$ with $(\lambda z.p)$ to get:

$$\rightarrow (\lambda z.p) \ (\lambda z.p)$$

How do you reduce this to $p$? (If it is possible)