During the Sangam period Tamil literateure flourished from the 3rd century BCE to the 4th century CE. In what part of India did the Tamil dynasties rule