can_phone(anne,bill).
can_phone(anne,mary).
can_phone(bill,tom).
can_phone(bill,sue).
can_phone(tom,liz).
can_phone(tom,frank).
can_phone(liz,frank).
message_route(A,B,[A,B]) :- can_phone(A,B).
message_route(A,B,[A|Tail]) :- can_phone(A,X), message_route(X,B,Tail).
:-message_route
(anne
,frank
,Chain
), write(Chain
).
Y2FuX3Bob25lKGFubmUsYmlsbCkuCmNhbl9waG9uZShhbm5lLG1hcnkpLgpjYW5fcGhvbmUoYmlsbCx0b20pLgpjYW5fcGhvbmUoYmlsbCxzdWUpLgpjYW5fcGhvbmUodG9tLGxpeikuCmNhbl9waG9uZSh0b20sZnJhbmspLgpjYW5fcGhvbmUobGl6LGZyYW5rKS4KbWVzc2FnZV9yb3V0ZShBLEIsW0EsQl0pIDotIGNhbl9waG9uZShBLEIpLgptZXNzYWdlX3JvdXRlKEEsQixbQXxUYWlsXSkgOi0gY2FuX3Bob25lKEEsWCksIG1lc3NhZ2Vfcm91dGUoWCxCLFRhaWwpLgo6LW1lc3NhZ2Vfcm91dGUoYW5uZSxmcmFuayxDaGFpbiksIHdyaXRlKENoYWluKS4=