what countries bordered on the north by poland and germany?