which president is a graduate of amherst academy?
Entity
m.01vbl
Calvin Coolidge
class class entity
government.us_president education.education m.0gdm1
government.us_president education.education education.university
US President Education amherst academy
none none none
people.person.education education.educational_institution.students_graduates
Education Students/Graduates
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX : <http://rdf.freebase.com/ns/> 
SELECT (?x0 AS ?value) WHERE {
SELECT DISTINCT ?x0  WHERE { 
?x0 :type.object.type :government.us_president . 
?x1 :type.object.type :education.education . 
VALUES ?x2 { :m.0gdm1 } 
?x0 :people.person.education ?x1 . 
?x2 :education.educational_institution.students_graduates ?x1 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x1 != ?x2  )
}
}
(AND government.us_president (JOIN people.person.education (JOIN (R education.educational_institution.students_graduates) m.0gdm1)))