Figure 3 depicts a mass (A) of 20 kg resting on another mass (B) of 100kg. Mass B rolls

without friction over the ground, but the interface between the masses is rough, μ=0.5.

Determine the accelerations of the masses if the force P in the cable is: (i) 60 N, (ii) 40 N

https://imgur.com/a/GmZXZ
I drew the FBD for mass A and got this:

y: -W + N = 0 => N=W=196.2

x: 2P - Fri = ma = 20a

And from both equations I got a=1.096 m/s^2 , which is correct

But I can't seem to find the acceleration for the second mass.

Would the force acting on mass B be the same as the friction force on A (but in opposite direction), since that is the force that will be moving the object? For the FBD, the weight of A would be acting downwards, as well as the weight of B. What are the reaction forces gonna be? I am really confused on how the two objects will interact since I've never done similar dynamics problems before.

Thanks for anyone who helps