 Although the Ayyubids were from the Shafi 'i denomination , they built schools for imparting instruction in all four of the Sunni systems of religious @-@ juridical thought . Before the Ayyubid takeover , there were no schools for the Hanbali and Maliki denominations in Syria , but the Ayyubids founded separate schools for them . In the mid @-@ 13th century , Ibn Shaddad counted in Damascus 40 Shafi 'i , 34 Hanafi , 10 Hanbali , and three Maliki schools . 
