 Complete the following phrase:  For the next quarter century, Poland was often a pawn in Russias campaigns against other powers. When John III died in 1697, 18 candidates vied for the throne, which ultimately went to Frederick Augustus of Saxony, who then converted to Catholicism. Ruling as Augustus II, his reign presented the opportunity to unite Saxony an industrialized area with Poland, a country rich in mineral resources. The King however lacked skill in foreign policy and became entangled in a war with Sweden. His allies, the Russians and the Danes, were repelled by Charles XII of Sweden, beginning the Great Northern War. Charles installed a puppet ruler in Poland and marched on Saxony, compelling Augustus to give up his crown and turning Poland into a base for the Swedish army. Poland was again devastated by the armies of Sweden, Russia, and Saxony. Its major cities were destroyed and a third of the population killed by the war and a plague outbreak in 1702-13. The Swedes finally withdrew from Poland and invaded Ukraine, where they were defeated by the Russians 