direct(amsterdam, seattle).
direct(amsterdam, paramaribo).
direct(seattle, anchorage).
direct(anchorage, fairbanks).

connection(X,Y) :- direct(X,Y).
connection(X,Y) :- direct(X,Z), connection(Z,Y).
