Task: Text Categorization
Input (English): Early alliances in this war were shuffled around by the treaties of Traventhal and Altranstadt. The end of one phase in this war saw the naval battle of Hang, and it continued in name only for three years after the throne devolved to Ulrika Eleonora and Frederick I following one commander's death at Frederikshald. Parts of Ingria and Karelia changed hands under the final peace which ended this war, the Treaty of Nystad. For 10 points, name this war including the battles of the Pruth River, Poltava, and Narva, that targeted Charles XII and ended in 1721 when Peter the Great secured control of the Baltic Sea from Sweden.
Output (English): History