The p-wave is wave B. The p-wave is always going to move faster than the s-wave. Wave B starts at the velocity of about 8 km/s and wave A starts at about 4 km/s. Since wave B is moving faster, it is the p-wave. The p-wave refracted off the outer core and the s-wave reflected.
The approximate boundary between the mantle and the outer core is 3000 km. The s-wave reflects off of the outer core and that happens at about 3000 km. The p-wave refracts off of the