finds solutions. maybe reconsider what is meant with the distinct constraint.