Newton's Second Law of Motion states, “The force acting on an object is equal to the mass of that object times its acceleration.” For both system, force is equal so that we can calculate as follows:
F1 = F2
m1a1 = m2a2
8 (7) = (m2) (4)
m2 = 14 kg
Hope this answers the question. Have a nice day.