The complete solution