Solving the Noether procedure for cubic interactions of higher spins in (A)dS