Title: How to solve with Prolog