The first composed chess problem was by the caliph Mutasim Billah of Baghdad around 840 A.D. The earliest known European collections of chess problems were copied at the English monasteries of Abbotsbury and Cerne Abbey in Dorset around 1250. In 1295 Nicholas de St. Nicholai wrote the Bonus Socius, the first great compilation of chess problems. The first problem-solving chess contest was held in London in 1854. It was won by Walter Grimshaw. The tournament was sponsored by the Chess Player’s Chronicle and limited to British composers only. The first study-composing tournament was held in 1862 and won by Bernhard Horwitz. The longest solution to a composed problem requires 292 moves.