Input: The Portuguese Restoration War was the name given by nineteenth-century Romantic historians to the war between Portugal and Spain that began with the Portuguese revolution of 1640 and ended with the Treaty of Lisbon in 1668. The revolution of 1640 ended the 60-year Iberian Union. The period from 1640 to 1668 was marked by periodic skirmishes between Portugal and Spain, as well as short episodes of more serious warfare, much of it occasioned by Spanish and Portuguese entanglements with non-Iberian powers. Spain was involved in the Thirty Years' War until 1648 and the Franco-Spanish War until 1659, while Portugal was involved in the Dutch-Portuguese War until 1663. In the seventeenth century and afterwards, this period of sporadic conflict was simply known, in Portugal and elsewhere, as the Acclamation War. The war established the House of Braganza as Portugal's new ruling dynasty, replacing the House of Habsburg. This ended the so-called Iberian Union.

Question: What war did Spain stop being involved with second: Thirty Years' War or Franco-Spanish War?

Input: For their last road game of the season, in week 16 the Lions traveled west to San Francisco to play the San Francisco 49ers. The Lions took an early lead midway through the first quarter with a 27-yard Jason Hanson field goal. The 49ers tied it up at the end of the first quarter with a 33-yard field goal by Ricky Schmitt. The only score of the 2nd quarter was a 39-yard 49ers field goal just before halftime. In the third quarter came 2 San Francisco TD's. First a 2-yard catch by Vernon Davis, then a 1-yard run by Frank Gore. The Lions kicked another field goal late in the 4th quarter from 38 yards out. The Lions road losing streak now stands at 20.And for the win, the 49ers improved their record to 7-8.With the loss, the Lions dropped their record to 2-13.

Question: Who scored the first touchdown?

Input: During the war, the Russian army organized the Crimean campaigns of 1687 and 1689 both which ended in Russian defeats. Despite these setbacks, Russia launched the Azov campaigns in 1695 and 1696, and after raising the siege in 1695 successfully occupied Azov in 1696.

Question: Which came first the he Crimean campaigns or the Azov campaigns?

Input: Soviet troops approached the Lithuanian territory on December 12, 1918. About 5,000 of them were Lithuanians. Three divisions were employed: Pskov division , International Division , and 17th Division . The divisions did not have a common military commander. Later more units were sent from Russia. The soviets also recruited partisan groups behind the front lines. Soviet soldiers were poorly supplied and had to support themselves by requisitioning food, horses, and clothes from local residents. Lithuania could not offer serious resistance as at the time its army consisted only of about 3,000 untrained volunteers. Only local partisans, armed with weapons acquired from retreating Germans, offered brief resistance. Red Army captured one town after another: Zarasai and Svencionys , Utena , Rokiskis , Vilnius , Ukmerge and Panevezys , Siauliai , Telsiai . That accounted for about of the Lithuanian territory. The front somewhat stabilized when Soviet forces were stopped near the Venta River by Latvian and German units . Also Germans slowed down withdrawal of their troops after the Spartacist uprising was subdued on January 12. Southern Lithuania was a little better protected as Germans retreated from Ukraine through Hrodna. To prevent fights between retreating Germans and the Red Army, the Soviets and Germans signed a treaty on January 18. The treaty drew a temporary demarcation line that went through Daugai, Stakliskes, and 10 kilometres east of Kaisiadorys-Jonava-Kedainiai railway. That barred Bolshevik forces from directly attacking Kaunas, Lithuania's second-largest city. The Red Army would need to encircle Kaunas and attack through Alytus or Kedainiai. The operation to take Kaunas began on February 7.

Question:
How many days after the Spartacist uprising was subded did the Soviets and Germans sign a treaty?