Exercise 2 : Constraint satisfaction problem