In the development of which religions did Magadha participate?