Identical small smooth spheres $A$ and $B$ lie on a smooth horizontal surface. Sphere $A$ is projected towards stationary sphere $B$ with speed $u$. The coefficient of restitution between the spheres is $\tfrac23$. Sphere $B$ is initially a distance $d$ from a fixed vertical wall, whose coefficient of restitution with $B$ is $\tfrac13$.
(i) Show that after striking the wall the speed of $B$ is $\tfrac{5u}{18}$. [4]
(ii) Find the distance of $B$ from the wall when the spheres collide for the second time. [6]