likes(john,mary). likes(john,fred). likes(fred,wine). good(X):-likes(john,X). good(X):-likes(john,Y),likes(Y,X). good(_).