CREATE
(a:Person {name: 'Alice'}),
(b:Person {name: 'Bob'}),
(c:Person {name: 'Carrie'}),
(d:Person {name: 'David'}),
(e:Person {name: 'Emily'}),
(a)-[:FRIENDS_WITH]->(b),
(a)-[:FRIENDS_WITH]->(e),
(b)-[:FRIENDS_WITH]->(c),
(b)-[:FRIENDS_WITH]->(d)
MATCH (a:Person {name: 'Alice'})-[:FRIENDS_WITH]-(:Person)-[:FRIENDS_WITH]-(fof:Person)
RETURN fof.name
MATCH path=(a:Person {name: 'Alice'})-[:FRIENDS_WITH]-(:Person)-[:FRIENDS_WITH]-(fof:Person)
RETURN path