8.7. Find all positive integer pairs $(x, y)$ that satisfy the equations $x+y=a^{n}, x^{2}+y^{2}=a^{m}$ for some positive integers $a$, $n$, and $m$.
8.7. Answer: $\left(2^{k}, 2^{k}\right), k$ is a non-negative integer.

From the problem, we have $a^{2 n}=x^{2}+2 x y+y^{2}=a^{m}+2 x y$. Therefore, $a^{2 n}>a^{m}$. Thus, $a^{2 n}$ is divisible by $a^{m}$.
Hence, $2 x y$ is divisible by $a^{m}=x^{2}+y^{2}$.
This leads to $2 x y \geqslant x^{2}+y^{2} \geqslant 2 x y$.
Thus, $x^{2}+y^{2}=2 x y, x=y$.
Therefore, $2 x=a^{n}, 2 x^{2}=a^{m}$.
Then, $4 x^{2}=a^{2 n}, 2=a^{2 n-m}$.
This gives $a=2, x=y=2^{k}, k$ is a non-negative integer.