Task: Question Generation
Input (English): Passage: With this victory, John I was recognised as the undisputed king of Portugal, putting an end to the interregnum and anarchy of the 1383-1385 crisis. Recognition from Castile would not arrive until 1411, after another Portuguese victory at the Battle of Valverde, with the signing of the Treaty of Ayllón. The English-Portuguese alliance would be renewed in 1386 with the Treaty of Windsor and the marriage of John I to Philippa of Lancaster, daughter of John of Gaunt. In 1387, taking advantage of the renewed alliance, John I, leading a Portuguese army of 9,000 men, reinforced by a 1,500-man English contingent that landed in Galicia, invaded Castile to sit John of Gaunt on the Castilian throne, which he claimed on his marriage to Infanta Constance of Castile. The Castilian forces refused to offer battle, after two months no significant town was taken and the allies, struck by disease and lack of supplies, met with an overwhelming failure. The treaty, still valid today, established a pact of mutual support between the countries: Indeed, Portugal would use it again against its neighbours in 1640, to expel the Spanish Habsburg kings from the country, and again during the Peninsular War. The Anglo-Portuguese Alliance would also be used by Britain  in the Second World War  and during the 1982 Falklands War.
Output (English): What happened first, John being recognized as the undisputed king, or the second world war?