Spring compression after collision

Consider two blocks A and B of masses m
1 = 10 kg and m
2 = 5 kg that are placed on a frictionless table. The block A moves with a constant speed ν = 3 m/s towards the block B kept at rest. A spring with spring constant k = 3000 N/m is attached with the block B as shown in the figure. After the collision, suppose that the blocks A and B, along with the spring in constant compression state, move together, then the compression in the spring is, (Neglect the mass of the spring)