Naive solver.