Let $N$ be a positive integer such that $N$ and $N^2$ both end in the same four digits $\overline{abcd}$, where $a \neq 0$. What is the four-digit number $\overline{abcd}$?

Let's think step by step and output the final answer within \boxed{}.
user