TASK DEFINITION: Given a question and a context passage, generate the answer having the word or phrase from the context passage. Here, the answer should be a shortest continous span from the passage.
PROBLEM: Context: The smallest front of the war was in Catalonia. In 1689 the Duke of Noailles had led French forces there aimed at bringing further pressure to bear on the Spanish by re-igniting a peasant rising against Charles II, which initially broke out in 1687. Exploiting the situation, Noailles captured Camprodon on 22 May, but a larger Spanish army under the Duke of Villahermosa forced him to withdraw back to Roussillon in August. The Catalan campaign settled down in 1690, but a new front in Piedmont-Savoy proved more eventful. A ferment of religious animosities and Savoyard hatred of the French produced a theatre characterised by massacres and atrocities: constant guerrilla attacks by the armed populace were met by draconian reprisals. In 1690 Saint-Ruth took most of the Victor Amadeus II's exposed Duchy of Savoy, routing the Savoyard army in the process until only the great fortress of Montmelian remained in ducal hands; while to the south in Piedmont, Nicolas Catinat led 12,000 men and soundly defeated Victor Amadeus at the Battle of Staffarda on 18 August. Catinat immediately took Saluzzo, followed by Savigliano, Fossano, and Susa, but lacking sufficient troops, and with sickness rife within his army, Catinat was obliged to withdraw back across the Alps for the winter. 
 Question: What happened first: Catalan campaign settled down or the Battle of Staffarda?

SOLUTION: catalan campaign settled down

PROBLEM: Context: Athabasca Valles is an outflow channel on Mars, cut into its surface by catastrophic flooding. 
 Question: The astronomical body that Athabasca Valles was located on was what?

SOLUTION: mars

PROBLEM: Context: The Toi invasion was the invasion of northern Kyushu by Jurchen pirates in 1019. At the time, Toi meant "barbarian" in the Korean language. The Toi pirates sailed with about 50 ships from direction of Goryeo, then assaulted Tsushima and Iki, starting 27 March 1019. After the Iki Island garrison comprising 147 soldiers was wiped out, the pirates has proceed to Hakata Bay. For a week, using Noko Island in the Hakata Bay as a base, they sacked villages and kidnapped over 1,000 Japanese, mostly women and young girls, for use as slaves. The Dazaifu, the administrative center of Kyushu, then raised an army and successfully drove the pirates away. During the second failed raid to Matsuura 13 April 1019, three enemies were captured by the Japanese army. They were identified as Koreans. They said that they had guarded the borderland but had been captured by the Toi. However, this was unlikely, and the Japanese officers suspected them because there had been Korean pirates attacking Japan coasts during the Silla period. A few months later, the Goryeo delegate Jeong Jaryang reported that Goryeo forces attacked the pirates off Wonsan and rescued about 260 Japanese. The Korean government then repatriated them to Japan where they were thanked by the Dazaifu and given rewards. There remain detailed reports by two captive women, Kura no Iwame and Tajihi no Akomi. These Jurchen pirates lived in what is today Hamgyongdo, North Korea. 
 Question: Who took 1000 Japanese for use as slaves?

SOLUTION:
toi pirates