We construct the general algebraic curve of degree four solving the classical sigma model on RxS5. Up to two loops it coincides with the algebraic curve for the dual sector of scalar operators in N=4 SYM, also constructed here. We explicitly reproduce some particular solutions.