Smooth uniform spheres $A$ and $B$, of equal radii and masses $m$ and $5m$, lie on a smooth horizontal surface. Sphere $A$ moves with speed $u$ and collides with stationary sphere $B$ at an angle $\theta$ to the line of centres. After the collision their kinetic energies are equal. The coefficient of restitution is $\tfrac12$. Find $\tan\theta$. [6]