You have to consider two impulses hitting mass B at the same time. If the impact between AB exchanges momentum (impulse) of magnitude $J_{AB}$ and the impact between BC exchanges momentum (impulse) of magnitude $J_{BC}$ then the change in velocities are
$$ \begin{aligned}
\Delta v_A & = \frac{-J_{AB}}{m_A} \\
\Delta v_B & = \frac{J_{AB}-J_{BC}}{m_B} \\
\Delta v_C & = \frac{J_{BC}}{m_C}
\end{aligned}$$
Now use the above in the law of contact that relates the final velocities to the initial velocities
$$ \begin{aligned}
(v_A + \Delta v_A) - (v_B + \Delta v_B) & = -\epsilon (v_A-v_B) & &\mbox{A to B contact}\\
(v_B + \Delta v_B) - (v_C + \Delta v_C) & = -\epsilon (v_B-v_C) & &\mbox{B to C contact}\\
\end{aligned}$$
Where $\epsilon=1$ is the coefficient of restitution.
These are two equations to be solved for the two unknown impulses, $J_{AB}$ and $J_{BC}$.
$$\begin{aligned}
J_{AB} & = (1+\epsilon) \frac{ m_A m_B (v_A-v_B) + m_A m_C (v_A-v_C)}{m_A+m_B+m_C} \\
J_{BC} & = (1+\epsilon) \frac{m_A m_C (v_A-v_C) + m_B m_C (v_B-v_C)}{m_A+m_B+m_C}
\end{aligned}$$
Finally use these the first set of expressions to find the change in velocities.