Rigid Body

A uniform rod of mass M and lenght l is free to move in a vertically about an axis that pass
at a point a<l/2 from the top. A bullet of mass m hits the rod horizontally at the top with a speed v.
What is the maximal angle for which the rod will rotate?