There may be an easier way to do this, but here is one way.
Draw a figure!
The point of origin, ship A and ship B form a triangle which has one side 10, one side 12 and a 10° angle between them.
Use the law of cosines to determine the distance between A and B.
Then use the law of sines to get angle B.
Look at your figure to see that the bearing you want is 28° less than angle B.
You can also do this another way:
Point A is (10 cos 142,10 sin 142) and Point B is (12 cos 152,12 cos 152)
The bearing you want is arctan of the slope of the line between these two points