solve both