Which country shared border with Nazi Germany until 1939?
SELECT ?obj WHERE { wd:/Nazi Germany/ p:/shares border with/ ?s . ?s ps:/shares border with/ ?obj . ?s pq:/end time/ ?x filter(contains(YEAR(?x),'1939')) }