Input: History of science
In mathematics, the Persian mathematician Muhammad ibn Musa al-Khwarizmi gave his name to the concept of the algorithm, while the term algebra is derived from al-jabr, the beginning of the title of one of his publications. What is now known as Arabic numerals originally came from India, but Muslim mathematicians did make several refinements to the number system, such as the introduction of decimal point notation. Sabian mathematician Al-Battani (850-929) contributed to astronomy and mathematics, while Persian scholar Al-Razi contributed to chemistry and medicine.

What was Muhammad ibn Musa al-Khwarizmi's profession?
Output: mathematician

Input: Valencia
Ferdinand refused and went to Valencia instead of Madrid. Here, on 17 April, General Elio invited the King to reclaim his absolute rights and put his troops at the King's disposition. The king abolished the Constitution of 1812. He followed this act by dissolving the two chambers of the Spanish Parliament on 10 May. Thus began six years (1814–1820) of absolutist rule, but the constitution was reinstated during the Trienio Liberal, a period of three years of liberal government in Spain from 1820–1823.

Who offered troops to the King?
Output: General Elio

Input: Supreme court
The Supreme Court is the highest court in Ireland. It has authority to interpret the constitution, and strike down laws and activities of the state that it finds to be unconstitutional. It is also the highest authority in the interpretation of the law. Constitutionally it must have authority to interpret the constitution but its further appellate jurisdiction from lower courts is defined by law. The Irish Supreme Court consists of its presiding member, the Chief Justice, and seven other judges. Judges of the Supreme Court are appointed by the President in accordance with the binding advice of the Government. The Supreme Court sits in the Four Courts in Dublin.

Ireland's highest court has the power to determine whether laws are allowed by what document?
Output: the constitution

Input: Carnival
In Catalonia people dress in masks and costume (often in themed groups) and organize a week-long series of parties, pranks, outlandish activities such as bed races, street dramas satirizing public figures and raucous processions to welcome the arrival of Sa Majestat el Rei Carnestoltes (His Majesty King Carnival), known by various titles, including el Rei dels poca-soltes (King of the Crackpots), Princep etern de Cornudella (Eternal Prince of Cuckoldry), Duc de ximples i corrumputs (Duke of Fools and the Corrupt), Marquès de la bona mamella (Marquis of the lovely breast), Comte de tots els barruts (Count of the Insolent), Baró de les Calaverades (Baron of Nocturnal Debaucheries), and Senyor de l'alt Plàtan florit, dels barraquers i gamberrades i artista d'honor dalt del llit (Lord of the Tall Banana in Bloom, of the Voyeurs and Punks and the Artist of Honor upon the Bed).

What are raced as part of the festivities? 
Output:
bed