Who was the teacher at the third madrasa