A block of mass M is pulled along a horizontal frictionless surface by a rope of mass m. If a force P is applied at the free end of the rope, the force exerted by the rope on the block will be

(1) P

(2) $\frac{Pm}{M+m}$

(3) $\frac{PM}{M+m}$

(4) $\frac{Pm}{M-m}$