We can draw a diagram.

The impulse applied to both balls is $I = \var{impulse} \, \mathrm{Ns}$, and the speeds after the collision are $v_1 = \var{A_speed} \, \mathrm{ms^{-1}}$ and $v_2 = \var{B_speed} \, \mathrm{ms^{-1}}$ for the balls $A$ and $B$ respectively.
a)
To calculate $u_1$, the speed of ball $A$ before the collision, we use the equation $I = m_1v_1 - m_1u_1$, where $m_1$ is the mass of ball $A$, which is $\var{A_mass} \, \mathrm{kg}$. We resolve in the direction of the impulse, therefore the signs of $v_1$ and $u_1$ will be reversed.
\begin{align}
I & = m_1v_1 - m_1u_1, \\
\var{impulse} & = \var{A_mass} (v_1 - u_1), \\
\frac{\var{impulse}}{\var{A_mass}} & = - \var{A_speed} - (- u_1), \\
u_1 & = \frac{\var{impulse}}{\var{A_mass}} + \var{A_speed}, \\
& = \var{siground( impulse/A_mass + A_speed,3)} \, \mathrm{ms^{-1}}.
\end{align}
The magnitude of the speed of $A$ before the collision is $\var{siground( impulse/A_mass + A_speed,3)} \, \mathrm{ms^{-1}}$.
b)
To calculate $u_2$, the speed of ball $B$ before the collision we use the equation $I = m_2v_2 - m_2u_2$, where $m_2$ is the mass of ball $B$, which is $\var{B_mass} \, \mathrm{kg}$. We resolve in the direction of the impulse shown in the diagram, which is the same as the direction of the speeds.
\begin{align}
I & = m_2v_2 - m_2u_2, \\
\var{impulse} & = \var{B_mass} ( \var{B_speed} - u_2), \\
\frac{\var{impulse} }{ \var{B_mass}} & = \var{B_speed} - u_2, \\
u_2 & = \var{B_speed} - \frac{\var{impulse} }{ \var{B_mass}}, \\
& = \var{siground( B_speed - (impulse/B_mass),3)} \, \mathrm{ms^{-1}}.
\end{align}
If this is positive it means the direction of ball $B$ we assumed is correct; if it is negative it means the ball was originally travelling in the other direction. However we were asked to find the magnitude of the speed so we take our answer as $\var{B_before_speed} \, \mathrm{ms^{-1}}$.