This interesting question is taken from an Iranian () competetion (high school level): (Have fun!)

Suppose $\displaystyle x,y,z$ are positive integers with $\displaystyle xy=z^2+1.$ Prove that there exist integers $\displaystyle a,b,c,d$ such that $\displaystyle x=a^2+b^2, \ y=c^2+d^2,$ and $\displaystyle z=ac+bd.$