You need to solve and simultaneously.

In the first congruence we can factor, this gives the solutions, . In the second congruence we can factor, this gives the solutions, . Now use the Chinese remainder theorem to get possibly 9 solutions up to congruence modulo .