Question: When was the peace treaty signed based on which Teutonic Knights suffered only minimal territorial losses?

<P0-S0> The Battle of Grunwald, First Battle of Tannenberg or Battle of Žalgiris, was fought on 15 July 1410 during the Polish–Lithuanian–Teutonic War. <P0-S1>  The alliance of the Kingdom of Poland and the Grand Duchy of Lithuania, led respectively by King Władysław II Jagiełło (Jogaila) and Grand Duke Vytautas, decisively defeated the German–Prussian Teutonic Knights, led by Grand Master Ulrich von Jungingen. <P0-S2>  Most of the Teutonic Knights' leadership were killed or taken prisoner. <P0-S3>  Although defeated, the Teutonic Knights withstood the siege of their fortress in Marienburg (Malbork) and suffered minimal territorial losses at the Peace of Thorn (1411) (Toruń), with other territorial disputes continuing until the Peace of Melno in 1422. <P0-S4>  The knights, however, would never recover their former power, and the financial burden of war reparations caused internal conflicts and an economic downturn in the lands under their control. <P0-S5>  The battle shifted the balance of power in Central and Eastern Europe and marked the rise of the Polish–Lithuanian union as the dominant political and military force in the region. <SEP> <P1-S0> The Treaty of Melno (Lithuanian: "Melno taika" ; Polish: "Pokój melneński" ) or Treaty of Lake Melno (German: "Friede von Melnosee" ) was a peace treaty ending the Gollub War. <P1-S1>  It was signed on 27 September 1422, between the Teutonic Knights and an alliance of the Kingdom of Poland and the Grand Duchy of Lithuania at Lake Melno (German: "Melnosee", "Meldensee"; Polish: "Jezioro Mełno"), east of Graudenz (Grudziądz). <P1-S2>  The treaty resolved territorial disputes between the Knights and Lithuania regarding Samogitia, which had dragged on since 1382, and determined the Prussian–Lithuanian border, which afterwards remained unchanged for about 500 years. <P1-S3>  A portion of the original border partially survives as the border between the Republic of Lithuania and Kaliningrad Oblast, Russia, making it one of the most stable borders in Europe. <SEP> <P2-S0> The Polish–Lithuanian–Teutonic War or Great War occurred between 1409 and 1411, pitting the allied Kingdom of Poland and Grand Duchy of Lithuania against the Teutonic Knights. <P2-S1>  Inspired by the local Samogitian uprising, the war began by Teutonic invasion of Poland in August 1409. <P2-S2>  While defeated, the Teutonic Knights withstood the siege on their capital in Marienburg (Malbork) and suffered only minimal territorial losses in the Peace of Thorn (1411). <P2-S3>  As neither side was ready for a full-scale war, Wenceslaus IV of Bohemia brokered a nine-month truce. <P2-S4>  After the truce expired in June 1410, the military-religious monks were decisively defeated in the Battle of Grunwald (Tannenberg), one of the largest battles in medieval Europe. <P2-S5>  Most of the Teutonic leadership was killed or taken prisoner. <P2-S6>  Territorial disputes lasted until the Peace of Melno of 1422. <P2-S7>  However, the Knights never recovered their former power and the financial burden of war reparations caused internal conflicts and economic decline in their lands. <P2-S8>  The war shifted the balance of power in Eastern Europe and marked the rise of the Polish–Lithuanian union as the dominant power in the region. <SEP> <P3-S0> The (First) Peace of Thorn was a peace treaty formally ending the Polish–Lithuanian–Teutonic War between allied Kingdom of Poland and Grand Duchy of Lithuania on one side, and the Teutonic Knights on the other. <P3-S1>  It was signed on 1 February 1411 in Thorn (Toruń), one of the southernmost cities of the Monastic State of the Teutonic Knights. <P3-S2>  In historiography, the treaty is often portrayed as a diplomatic failure of Poland–Lithuania as they failed to capitalize on the decisive defeat of the Knights in the Battle of Grunwald in June 1410. <P3-S3>  The Knights returned Dobrzyń Land which they captured from Poland during the war and made only temporary territorial concessions in Samogitia, which returned to Lithuania only for the lifetimes of Polish King Władysław Jagiełło and Lithuanian Grand Duke Vytautas. <P3-S4>  The Peace of Thorn was not stable. <P3-S5>  It took two other brief wars, the Hunger War in 1414 and Gollub War in 1422, to sign the Treaty of Melno that solved the territorial disputes. <P3-S6>  However, large war reparations were a significant financial burden on the Knights, causing internal unrest and economic decline. <P3-S7>  The Teutonic Knights never recovered their former might.