A rod of mass m and length l is kept on a smooth wedge of mass M as shown in the figure. If the system is released, find the speed of the wedge when the rod hits the ground level, neglecting friction in all contacting surfaces.