Question: Rutherford B. Hayes replaced Ulysses S. Grant in what office?
Paraphrase: In what office did Rutherford B. Hayes replace Ulysses S. Grant?
SPARQL (Wikidata): SELECT ?obj WHERE { wd:Q35686 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1365 wd:Q34836 }