A $3$-$4$-$5$ right $\triangle ABC$ ($AC=5$) fits in a square such that $A$ is also vertex of the square. Find the side of square. 
A right angle triangle ABC of sides $3$, $4$, and $5$ ($AC=5$) is fit in a square such that $A$ is also vertex of square . Find the side of square.

Some error is occurring while uploading picture. If you have some problem understanding ask me in comments.
My attempt:
I tried to use Pythagoras by assuming side $x$. But I think I am missing something. There should be an easy way to finish it.
\color{red}{ Is this square unique ?}

If $A$ is a vertex of the square; and $B$ in on a side of the square not adjacent to $A$; and $C$ is on the other side not adjacent to $A$.
And if the side of the square in $s$ we can, using cartesian coordinates, assume $A$ is at $(0,0)$ and $B$ is at $(s,y)$ and $C$ is at $(x, s)$.
Then we have $s^2 + y^2 = 4^2$ and $x^2 + s^2 = 5^2$ and $(s-x)^2+(y-s)^2 = 3$
Solve for $s$. (If possible)
If $s > 4$ then that isn't the best fitting.  The best fitting is that $AB$ is the side of the $4\times 4$ square.
