The imperial examination (keju) selected officials by open examination in subjects — founded in the Sui, abolished at the Qing's end, some thirteen hundred years in run. Emperor Wen of Sui abolished the nine ranks and ordered the provinces to recommend by subject; Emperor Yang created the jinshi degree and the system stood. The Tang inherited and enlarged it with the regular classics and jinshi degrees — Wu Zetian instituting the palace examination and the military exam — the jinshi rising to first place; the Northern Song enlarged quotas and fixed the anti-fraud devices of sealed names and transcribed papers, and after Wang Anshi's reforms (the Xining reforms) took men by classics-essay and policy. Ming-Qing settled the three tiers of provincial, metropolitan and palace examination with the eight-legged essay as fixed form and the Four Books and Five Classics as the canon of questions. In 1905 the Qing abolished the examinations for the schools — the system closed. Keju broke the great clans' monopoly of office, widened the ruling base, let poor scholars rise by talent and moved the social ladder — reading for the examinations becoming the default ambition of traditional society; the modern Western civil-service examination borrowed its experience.