The lens formula is 1/f = 1/v - 1/u. The magnification formula is -v/u = h'/h.
From the magnification formula, we get v = -20/50 * u. Substituting this into the lens formula gives us 1/f = -50/20 * 1/u - 1/u. Solving this equation for f will give you the focal length of the lens.