School work in Prolog