$x$ and $y$ are both even or both odd, since $x^2-y^2$ is even.
Suppose they are both even.
$4m^2-4n^2=4(m^2-n^2)$ is a multiple of $4$, but $12345678$ is not divisible by $4$.
$x,y$ can't be both even.
Suppose now they are both odd
$(2m+1)^2-(2n+1)^2=4m^2+4m+4n^2+4n=4(m^2+m+n^2+n)$ is a multiple of $4$ and this can't be true so $x,y$ can't be both odd.
This means that there are no numbers satisfying the given property.
Hope this can be useful
Actually the solution given in the image OP posted is not very clear. Why both odd? And why $x^2-y^2$ must be a multiple of $8$?
This last one is actually true because
$$4(m^2+m+n^2+n)=4 (m-n) (m+n+1)$$
as one of the two factors $m-n$ or $m+n+1$ is even, then the result is divisible by $8$