What position did James G. Blaine hold when he was replaced by John W. Foster?
SELECT ?obj WHERE { wd:Q448778 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1366 wd:Q703642 }
james g. blaine: Q448778 john w. foster: Q703642