what is the {end time} for {Mainz} has {country} as {Kingdom of Prussia} ?
When did Mainz cease to be a part of the Kingdom of Persia?
SELECT ?value WHERE { wd:Q1720 p:P17 ?s . ?s ps:P17 wd:Q27306 . ?s pq:P582 ?value}
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q1720> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P17> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q27306> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

From which year did Mainz ceased to be a part of the Kingdom of Persia?