The best thing to do in such cases is to find the equations of motion for the each body, i.e. their exact location at any moment. Let the stones move along the y-axis (positive direction upwards).
For stone thrown upwards, you have
y_{up}=v_{0}t-\frac{1}{2}gt^{2},
where v_{0} is the...