A small object is placed in front of a concave mirror gives real image and image is 4 times the object. When the object is moved towards the mirror, a virtual image of same magnification is formed. Find the focal length of the mirror.