Exercise for the Artificial Intelligence course.