Bethe Ansatz for Quantum Strings