I was looking for this, but I can't find anything.
Problem. Let $A, B$ two compact surfaces such that $A\#B \cong S^2$ then $A\cong B \cong S^2$.
I considerd infinite connected sum $A\#B\#A\dotsc$ and $B\#A\#B\dotsc$ These are homeomorphic to $\mathbb{R}^2$ and with $\{\infty\}$ to $S^2$, but I cant finalize the prove.
Can you get me a hint? Thank
Edit. Can I prove it using this? Connected sum of non orientable surfaces is non orienable, then A and B are orientables, in fact, are respectively connected sum of n and m torus. Hence we also know that connected sum of A and B is homeomorphic to the connected sum of $n+m$ torus. Therefore $m+n=0$ and $m,n\geq 0$ so $m=n=0$.
Compact surfaces form a (commutative) monoid under connected sum where $S^2$ is the identity. If you don't already know that, just consider what connected sum does, it cuts out a disk and identifies the boundary, so if you have anything non-orientable it stays that way, and if you have any handles, it only increases the number of handles.