select distinct ?x where { ?x . ?y . ?x ?y. ?z ?y. ?z . ?z ?w. ?w . }